开发者

Memory management in iphone

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜