내가 가진 :아이폰 오브젝티브 C 자체의 문제
- (void)viewDidLoad {
NSArray *array = [[NSArray alloc]initWithObjects:@"Pictures",@"Video",@"Text",@"Map",nil];
self.selectionList = array;
[array release];
[super viewDidLoad];
}
...
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
NSUInteger row = [indexPath row];
cell.textLabel.text = [selectionList objectAtIndex:row];
return cell;
}
내 질문은 이것이다, 이유있는 viewDidLoad 섹션에, 그것은 self.selectionList뿐 아니라 selectionList 할 필요합니까? 내 말은, 요점은 selectionList 배열에 방금 작성한 배열의 내용을 전달하는 것입니다. 그래서 왜 자기입니까?
속성 및 Objective-C 메모리 관리에 대한 설명 – nduplessis
사이드 노트 : 'viewDidLoad'는 먼저 부모 호출 (첫 번째 줄)을 가져야합니다. –
@ 케빈 : 차이를 만들어서는 안됩니다. 애플의 문서에서는 종종 전혀 그렇지 않습니다. – Eiko