How is retain setter implemented with @synthesize?

前端 未结 6 978
逝去的感伤
逝去的感伤 2020-12-10 19:01

I have the following in the header:

@property (nonatomic, retain) UIView *overlay;

And in the implementation:

@synthesize o         


        
6条回答
  •  臣服心动
    2020-12-10 19:47

    If you assign the object directly to the property, you still must release it:

    self.overlay = [[[UIView alloc] initWithFrame:CGRectMake(160.0f, 70.0f, 150.0f, 310.0f)] autorelease];
    

提交回复
热议问题