My app crashes when I scroll the UITableView over the first cell or the last cell!
Why this is happening? I add with addObject:name the objects of the UItableview . This is the code I use at cellForRowAtIndexPath
. Help please! I have been trying to figure out what is going wrong hours!
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString * DisclosureButtonCellIdentifier =
@"DisclosureButtonCellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:
DisclosureButtonCellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier: DisclosureButtonCellIdentifier]
autorelease];
}
NSUInteger row = [indexPath row];
NSString *rowString =nil;
rowString = [list objectAtIndex:row];
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
[rowString release];
return cell;