Had this semantic issue while showing the xml parsed data in the table cell view. application runs successfully but when i select any row then app goes in detail view at that time app crashes. Pls help!!!
Semantic issue occurs in the third case in this line
cell.textLabel.text = aBook.bookID;
App Code:
- (UITableViewCell *)tableView:(UITableView *)tv
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell =
[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier] autorelease];
}
switch (indexPath.section) {
case 0:
cell.textLabel.text = aBook.name;
break;
case 1:
cell.textLabel.text = aBook.author;
break;
case 2:
cell.textLabel.text = aBook.price;
break;
case 3:
cell.textLabel.text = aBook.bookID;
break;
}
return cell;
}
Probably your aBook.bookID variable is a NSInteger, to convert it in a NSString use this: