0
votes

I'm getting this error when I tried to put my array content into the table view:

2011-03-17 15:54:13.142 FullApp[6851:207] -[NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x5903860

2011-03-17 15:54:13.143 FullApp[6851:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x5903860'

And here is my code:

- (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] autorelease];
}

// Configure the cell.
FullAppAppDelegate *fullapp = (FullAppAppDelegate *)[[UIApplication sharedApplication]delegate];

NSString *cellValue = [[fullapp.soapResults objectAtIndex:0] objectAtIndex:indexPath.row];

cell.textLabel.text = cellValue;

Here is my array content:

2011-03-17 16:00:29.976 FullApp[6898:207] (
"Everyday.com.my",
"Mydeals.com.my"
)
3

3 Answers

1
votes

[fullapp.soapResults objectAtIndex:0] is "Everyday.com.my". You are calling objectAtIndex:indexPath.row of this string.

0
votes

Probably fullapp.soapResults might be a NSString or [fullapp.soapResults objectAtIndex:0] might be a NSString

0
votes

Pls check fullapp.soapResults. It might be declared as NSString in the appDelegate. try making it as an NSArray.