Created
April 9, 2012 20:30
-
-
Save MrRooni/2346405 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Update: The plot thickens! In a Mac project you get the behavior outlined below where dragged and dropped | |
// IBOutlet property creation yields (assign)'ed properties. In an iOS project however, dragged and dropped | |
// IBOutlets get created thusly: | |
@property (retain, nonatomic) IBOutlet UIButton *someButton; | |
// -- Original post begins here: | |
// Since the inception of properties I've written IBOulet properties like so: | |
@property (nonatomic, retain) IBOutlet NSButton *someButton; | |
// Today I dragged and dropped from interface builder to my header file in Xcode 4 to create an outlet and got this: | |
@property (assign) IBOutlet NSButton *someButton; | |
// Given that atomic properties get extra thread-safety in their generated accessors it has always made | |
// more sense to me to have nonatomic accessors and save on the overhead. As such I was surprised to see | |
// that atomic IBOutlets are the Xcode default. The question I have is: why is atomic the Xcode default | |
// for IBOutlets? |
Have you heard anything about this from anyone (perhaps someone inside of Apple)?
The rumor is that it's just different styles between the App Kit and UI Kit teams and how they decided Xcode should handle these things.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well regarding the iOS/Mac bit, I believe non-property IBOutlets in iOS are retained vs not on the mac, so the properties are matching to that. Though I'd love to hear about why one is atomic and one is not.