我有这个小问题,我找不到Google: UITableView
工作正常,直到我开始滚动。- [NSCFString objectAtIndex:]:无法识别的选择器
Error Message: `-[NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x5f24870 `
方法:
- (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;
}
就猜到这是“问题” - 方法......如果你需要更多的相关信息:请告诉我:) 感谢您的帮助!
编辑: myArray的仅仅是正常NSArray *myArray
这是一个排序的数组 - >
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"lesson" ascending:YES];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
myArray = [resultArray sortedArrayUsingDescriptors:sortDescriptors];
resultArray(NSMutableArray的)是一个XML解析器的结果..希望你能看到我的问题..
如何创建myArray的对象? – Vladimir 2010-10-18 14:56:38
感谢您的意见..见编辑.. – dav3 2010-10-18 15:08:51