Hello.
I have a UITableView and three arrays.
One for section 1, next for section 2, last carries both arrays.
When I add a value to the first array I get the error SIGABRT.
PS: What is a good book to help learn Objective-C?
Thanks!
I have a UITableView and three arrays.
One for section 1, next for section 2, last carries both arrays.
When I add a value to the first array I get the error SIGABRT.
Code:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
if(section == 0) {
return [array1 count];
}
if(section == 1) {
return [array2 count];
}
}
- (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];
}
[U][B]//SIGABRT HAPPENS ON LINE BELOW[/B][/U]
cell.textLabel.text = [NSString stringWithFormat:@"%@",[[botharrays objectAtIndex:indexPath.section] objectAtIndex:indexPath.row]];
cell.backgroundColor = [UIColor colorWithWhite:100 alpha:.65f];
return cell;
}
PS: What is a good book to help learn Objective-C?
Thanks!