테이블뷰 사용시 cell을 동적으로 추가하거나 삭제해야 하는 경우가 발생한다. 이럴 때 사용하는 소스코드 예를들어 cuscell *cus; //CustomCell UITableView *table; NSMutableArray *data; data = [NSMutableArray arrayWithObjects:@"Item 1", @"Item 2", nil]; 를 선언하고 테이블뷰에서 data의 값을 가져온다고 하자. cell 추가 [self.data addObject:@"New Item"]; [table beginUpdates]; NSArray *paths = [NSArray arrayWithObject:[NSIndexPath indexPathForRow:1 inSection:0]]; [table inse..
//테이블뷰 섹션의 수 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 2; } //테이블뷰 Row의 갯수 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 1; } //테이블뷰 Row의 높이 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 50; } //테이블뷰 섹션 타이틀 지정 - (NSString *) tableView:(UITableView *)table..