Objective C implementing a UIPickerView with a “Done” button

The easiest way to do it is to model it in Interface Builder. It is a UIView containing a UIToolbar and a UIPickerView. Then create an outlet for the UIView and connect it. If you then have a UITextField you can assign your custom view to its inputView property. [self.textField setInputView:self.customPicker]; Alternatively you can add … Read more

iOS: Keep application running in background

Yes, no need to jailbreak. Check out the “Implementing long-running background tasks” section of this doc from Apple. From Apple’s doc: Declaring Your App’s Supported Background Tasks Support for some types of background execution must be declared in advance by the app that uses them. An app declares support for a service using its Info.plist … Read more

Can I disable autolayout for a specific subview at runtime?

I had the same problem. But I have resolved it. Yes, you can disable auto layout at runtime for a specific UIView, instead of disabling it for the whole xib or storyboard which is set by default in Xcode 4.3 and later. Set translatesAutoresizingMaskIntoConstraints to YES, before you set the frame of your subview: self.exampleView.translatesAutoresizingMaskIntoConstraints … Read more

How to create a .gitignore file

If you’re using Windows it will not let you create a file without a filename in Windows Explorer. It will give you the error “You must type a file name” if you try to rename a text file as .gitignore To get around this I used the following steps Create the text file gitignore.txt Open … Read more