I created an Xcode 4.5.2 project starting with the Single View Application for iPhone template. After adding a UIButton to MainStoryboard.storyboard, I'm able to control-drag from the button to ViewController.h's code to create a new IBOutlet or IBAction.
However, if I remove the last line following @end
, which is empty, control-dragging does not offer to create an IBOutlet or IBAction.
If I add a property to ViewController, then control-dragging offers to create IBOutlets and IBActions again.
Edit 1: As jhilgert00 pointed out, adding curly braces, as if to create a place to declare instance variables, causes Xcode to once again offer to create IBOutlets and IBActions.
Is this an Xcode bug? Or should I not trim the empty line after @end
?
Edit 2: This issue has been fixed in Xcode 5.
My answer would be that this is a bug that should be filed at https://bugreport.apple.com, I doubt anyone here can give a useful answer. That said it's always a good idea to leave whitespace at the end of a file!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With