In .h file,
NSString *deal_desc,*terms_cond,*merchant_desc,*locationaddress,*locationcity,*locationstate;
Trying to find the length of the 'detailarray', so that it could help me to allocate the height of the cell in table.
deal_desc = @"sadsad dsa dsad dsad sadsa dsad sadsad adsad sadsad adssad sad adsad sada";
terms_cond = @"sadsad adssa sad asdsad ";
merchant_desc = @"merchant description describes in detail about merchants";
locationaddress =@"42, South St";
locationcity = @"San Jose";
locationstate = @"California";
location = [[NSMutableArray alloc]init];
NSLog(@"location is %@ \n",location);
detaildescription = [[NSMutableArray alloc]init];
[location addObject:locationaddress];
[location addObject:locationcity];
[location addObject:locationstate];
[detailarray addObject:deal_desc];
[detailarray addObject:terms_cond];
[detailarray addObject:location];
[detailarray addObject:merchant_desc];
NSLog(@"detailarray values are %@ \n",detailarray);
While selecting the tablecell, i try to calculate the length of the string and array in 'detailarray', here
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
[self.tableview beginUpdates];
id1=indexPath.row;
size = [ detailarray[id1] length];
NSLog(@"size of detaildesc is %d \n",size);
[self.tableview endUpdates];
[tableview reloadData];
}
The problem that makes my app to crash is, finding the 'location' length, error as follows:'-[__NSArrayM length]: unrecognized selector sent to instance 0x717e8e0'
Can any one help me in this regards.