iOS 6 Automatic Property Synthesizer Tutorial Xcode 4.5 Example

visibility 43 回視聴 schedule 12年前 timer 6:21
open_in_new Dailymotion
http://www.mybringback.com<br />Jake's G+ = http://goo.gl/Of4a0<br />Travis's G+ = http://goo.gl/xGz4q<br /><br />iOS 6 Automatic Property Synthesizer Tutorial Xcode 4.5 Example<br /><br />In the newest update of Xcode 4.5 Apple includes Apple LLVM compiler 4.0, which adds quite a few new Objective C features. One of the key features that most have ran into, is the default synthesis of properties. In this tutorial we briefly go over the new defaults that the compiler adds for us.<br /><br />header file (.h)<br />@property (weak, nonatomic) IBOutlet UILabel *label;<br /><br />implementation (.m)<br />@synthesize label = _label;<br /><br />Previously, the compiler would synthesize and it would appear in the implementation file (.m). Now the compiler no longer needs the @synthesize directive within the implementation file because it will be provided by default.<br /><br />The default naming convention for instance variables always has an underscore. See example below.<br /><br />Setting the property of the label:<br />_label.text = @"hello";<br /><br /><br />If you want to learn more, check out http://www.mybringback.com<br /><br />Hit us up on G+, facebook, or twitter!<br /><br />http://www.facebook.com/mybringback<br />http://www.twitter.com/mybringback<br />http://www.todaysawesomesauce.com<br />-------------<br /><br />Thanks to Nolan for the Intro Music!