1
@ Synthesize window = _ window;
2
@ Synthesize viewController = _ viewController;
Generally, no = part is included. @ synthesize window = _ window. How can this problem be solved? What are the variables of _ window and _ viewController?
In the. h file, no window and viewController instance variables are defined in the class. How can I declare @ perproty?
1
# Import <UIKit/UIKit. h> <a href = "http://my.oschina.net/liwenlong7758" target = "_ blank" rel = "nofollow"> @ class </a> ViewController; <a href = "http://my.oschina.net/interface" target = "_ blank" rel = "nofollow"> @ interface </a> AppDelegate: NSObject <UIApplicationDelegate>
2
3 www.2cto.com
@ Property (nonatomic, retain) IBOutlet UIWindow * window;
4
@ Property (nonatomic, retain) IBOutlet ViewController * viewController;
5
<A href = "http://my.oschina.net/u/567204" target = "_ blank" rel = "nofollow"> @ end </a>
In 32-bit mode, if the @ interface part of the class is not declared as ivar, but there is a @ property declaration, @ synthesize is returned in the @ implementation part of the class, the following compilation error is returned:
Synthesized property 'xx' must either be named the same as a compatible ivar or must explicitly name an ivar
In 64-bit mode, the system automatically adds ivar to the class during runtime. The added ivar is prefixed with an underscore.
@ Synthesize window = _ window in the Declaration above indicates that the window attribute is the _ window instance variable synthesis accessors method.
Author: it_machine _