Hi,
I am newbie of develop Iphone application. I am reading a code sample. I have a question for a part of code.
Here is my code:
So, my question is in the viewDidLoad() method above, it does not release the "tempArray" object. But why it does not cause a memory leak problem?
Hope someone can give me some comments and explanation. Thanks a lot.
I am newbie of develop Iphone application. I am reading a code sample. I have a question for a part of code.
Here is my code:
Code:
[B][U]TableViewController.h[/U][/B]
@interface TableViewController : UITableViewController {
NSArray * tableDataList;
}
@property (nonatomic, retain) NSArray * tableDataList;
@end
[B][U]TableViewController.m[/U][/B]
@implementation TableViewController
@synthesize tableDataList;
-(void) viewDidLoad {
NSArray * [COLOR="RoyalBlue"]tempArray[/COLOR] = [[NSArray alloc] initWithObjects:@"Item 1", @"Item 2", @"Item 3", nil];
self.tableDataList = tempArray;
}
@end
So, my question is in the viewDidLoad() method above, it does not release the "tempArray" object. But why it does not cause a memory leak problem?
Hope someone can give me some comments and explanation. Thanks a lot.
Last edited by a moderator: