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 = ...;
精彩评论