[샘플]
#pragma mark UITableView dataSource
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if(tableView == societyTable) {
return [societyItems count];
} else if(tableView == digitalTable) {
return [digitalItems count];
}
else
return 0;
}
// Customize the appearance of table view cells.
- (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];
}
// Configure the cell.
if(tableView == societyTable) {
item* obj = (item *)[societyItems objectAtIndex:indexPath.row];
[[cell textLabel] setText:[obj title]];
} else if(tableView == digitalTable) {
item* obj = (item *)[digitalItems objectAtIndex:indexPath.row];
[[cell textLabel] setText:[obj title]];
}
return cell;
}
'iPhone' 카테고리의 다른 글
UIWebView 와 Application (App) 간의 통신 (15) | 2010.11.15 |
---|---|
Debug 시에만 NSLog 출력 하기. (Debug 모드 구분하기) (0) | 2010.10.12 |
APNS(Apple Push Notification service) 인증서 파일(p12) 만들기 (0) | 2010.10.07 |
Application Loader에서 애플 개발자 계정 설정 변경 (6) | 2010.09.30 |
UILabel에 중앙선(취소선) 표시하기. (UIStrikeLabel) (16) | 2010.09.16 |
APNS 를 위한 Device Token 알아내기 (7) | 2010.09.06 |
HTML Page 에서 아이폰 키보드 자판 선택 (0) | 2010.08.18 |
IB에서 각 UIControlState 에서의 UIButton 의 이미지 설정 (0) | 2010.08.13 |
APXML Sample Source (10) | 2010.08.05 |
APXML 를 사용 해 보세요. (26) | 2010.07.29 |