.h
@property (nonatomic, retain) NSArray *m_plistData;
.m
@synthesize m_plistData;
- (void)viewDidLoad
{
NSArray *array = [[NSArray alloc]initWithObjects:@"0",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11",@"12",@"13",@"14", nil];
m_plistData = array;
NSArray *nn = m_plistData;
[super viewDidLoad];
}
I use breakpoint and found array is normal,but m_plistData has no values,shows “out of scope”,I can’t understand why nn can get normal values
arrayis a local reference variable. It just lasts untilviewDidLoadmethod. Now,The above statement doesn’t make a deep copy. It is just a shallow copy.
If your objective is have elements in
m_plistData, directly do –