I have this little problem I couldn't find in Google:
UITableView
works fine until I start scrolling.
Error Message: `-[NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x5f24870 `
Method:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *MyIdentifier = @"MyIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease];
}
// Set up the cell
int storyIndex = [indexPath indexAtPosition: [indexPath length]-1];
//populate cell
cell.textLabel.text = [[myArray objectAtIndex: storyIndex] objectForKey: @"subject"];
return cell;
}
Just guessed that was the "problem"-method... if you need more infos: please tell me :) thanks for all your help!
EDIT:
myArray is just the normal NSArray *myArray
It's a sorted Array ->
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"lesson" ascending:YES];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
myArray = [resultArray sortedArrayUsingDescriptors:sortDescriptors];
resultArray (NSMutableArray) is the Result of an XML-Parser.. hope you can see my problem..