开发者

Memory management in iphone

开发者 https://www.devze.com 2023-01-24 07:04 出处:网络
I have a class where i have define a arra开发者_StackOverflowy as a retain property such as: @property (nonatomic,retain) NSMutableArray *temp;

I have a class where i have define a arra开发者_StackOverflowy as a retain property such as:

@property (nonatomic,retain) NSMutableArray *temp;

can i use the self.temp = self.temp; if yes can any one tell setter method for this and step by step implementation for this looking forward from here.

Thanks


If you want a setter method declare your NSMutableArray in your header file:

{
    NSMutableArray *temp;
}

@property(nonatomic, retain) NSMutableArray *temp;

And then in the main file make sure you call this after the @implementation MyClass:

@synthesize temp;

This gives you your getter and setter methods so from outside this class you can call MyClass.temp = ...;

0

精彩评论

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