Macbook Pro – Make an external monitor your primary display

Recently, I got a mac laptop at work, which is sup[er sweet, but I wanted to hook it up to a real monitor, keyboard and mouse. All very easy things to do. The problem I had was that the laptop was acting as the primary monitor. Every application that I drug over to the secondary monitor worked great, but the application tool bar was still on the laptop.. annoying.

I did a quick Google search to see if there was a solution to the problem. There was, and it’s dead simple to put into action.

Connect the external monitor

  • Start up the “System Preferences” app
  • Click on “Display Preferences”
  • Within Display Preferences, choose Arrangement. You should see two blue squares that represent each display, main and secondary. On the main display you’ll notice a bar along the top.
  • Click and drag this bar from the Main Display to the Secondary Display.
  • Close Display Preferences
  • That’s it!

UITextField.text is not always there!

If you have UITextField in your app and you want to validate a value or  see is there something in it you might think to write some code like this:

if (![addNewCellTextField.text isEqualToString:@""])

You would be right, but this will fail if the field is never touched! When a user taps the field, and it gets focus, UITextField.text = nil. That means that the condition above would be true, thats not what we want at all!

But once the UITextField is touched, the value becomes an instance of NSString with value of @””.  So make sure that you write your code to check for the nil case, like this:

if (addNewCellTextField.text != nil && ![addNewCellTextField.text isEqualToString:@""])