Ios5 programming @ synthesize window = _ window

Source: Internet
Author: User

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 _

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.