본문 바로가기

개발도구/iOS - 아이폰 개발

[ios] tableview 내용 편집, nibWithNibName

- (void)_startTimerThread

{

//  Tableview delegate로 다른 클래스에서 호출해오기

    NSLog(@" 세션수 = %d ", [self.tbl numberOfSections] );

    NSLog(@" 세션의 행수 = %d ", [self.tbl numberOfRowsInSection:0] );

    NSLog(@" NSIndexPath 만들기 =%@ ", [NSIndexPath indexPathForRow:0 inSection:0] );

    NSLog(@" 현재 선택된 =%d ", [[self.tbl indexPathForSelectedRow] row] );

    NSLog(@" 현재 선택된 세션 =%d ", [[self.tbl indexPathForSelectedRow] section] );

 

// CellForRow에서 이미 정의된 Cell 을 다른 클래스에서 일회성 사용

    static NSString *CellTableIdentifier = @"Cell";

    UINib *nib = [UINib nibWithNibName:@"CustomCellA" bundle:nil];

    [tbl registerNib:nib forCellReuseIdentifier:CellTableIdentifier];

    CustomCell *cell = [tbl dequeueReusableCellWithIdentifier:CellTableIdentifier];

    NSLog(@"cell text = %@" , cell.userTextLabel.text);

    NSLog(@"cell text = %@" , [messages objectAtIndex:[[self.tbl indexPathForSelectedRow]row]]);


}