“First Responder” – Did I get that right?

Right overall picture, wrong implementation details in the first paragraph. A “First Responder” in a NibFile is an Object … No, actually, First Responder is nil. Connecting a UI control (e.g., button) to First Responder in a nib is equivalent to [control setTarget:nil] in code. The reason for the First Responder fake-object in the nib … Read more

Checking if a .nib or .xib file exists

Macro #define AssertFileExists(path) NSAssert([[NSFileManager defaultManager] fileExistsAtPath:path], @”Cannot find the file: %@”, path) #define AssertNibExists(file_name_string) AssertFileExists([[NSBundle mainBundle] pathForResource:file_name_string ofType:@”nib”]) Here are a set of macros that you can call before you try an load a .xib or .nib, they will help identify missing files and spit out useful message about what exactly is missing. Solutions Objective-C: … Read more

Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape?

I found a much better way that works independent of the nav controller. Right now, I have this working when embedded in a nav controller, and when NOT embedded (although I’m not using the nav controller right now, so there may be some bug I’ve not seen – e.g. the PUSH transition animation might go … Read more

IBOutlet properties nil after custom view loaded from xib

That’s expected, because the IBOutlet(s) are not assigned by the time the initializer is called. Instead of calling commonInit() in init(coder:), do that in an override of awakeFromNib as follows: // … required init(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } override func awakeFromNib() { super.awakeFromNib() commonInit() } // …

How to disable Interface Builder document versioning from auto updating?

Version 4.6.3 of Xcode resolves this issue. However, as the comments state, you all need to be running that same version. If four developers are on 4.6.3, and one is on a previous version, then that developer will experience the same issue. However, if they do not commit that change then it will not affect … Read more

tech