开发者

Do you need to release an @property?

Do you need to @property (nonatomic, assign) int var开发者_如何学Ciable; in the .m file? If not, is there a reason why you don't need to release it?


Yes, there's a good reason not to release it - it's not an object. And you should use @synthesize in your implementation (.m), and @property in your interface (.h).

Apple's The Objective-C Programming Language is a great place to find answers to questions like this.


You need to release only those variable that you allocated or used.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜