Iphone NSArrayM长度:发送到实例的选择器无法识别

Iphone NSArrayM长度:发送到实例的选择器无法识别,iphone,nsmutablearray,Iphone,Nsmutablearray,在我被炒之前,让我说,我已经看过了几乎所有关于“未识别的选择器发送到实例”的答案,并尝试了一些建议,但似乎没有任何效果。这是我的问题 我在viewDidLoad函数中调用我的函数CreateAboutData -(void)createAboutData { NSMutableArray *aboutText; aboutSections = [[NSMutableArray alloc] initWithObjects:@"About", nil]; aboutTex

在我被炒之前,让我说,我已经看过了几乎所有关于“未识别的选择器发送到实例”的答案,并尝试了一些建议,但似乎没有任何效果。这是我的问题

我在
viewDidLoad
函数中调用我的函数
CreateAboutData

-(void)createAboutData
{
    NSMutableArray *aboutText;

    aboutSections = [[NSMutableArray alloc] initWithObjects:@"About", nil];
    aboutText = [[NSMutableArray alloc] init];
    //Set About Info
    [aboutText addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Scoring",@"title",@"Scoring blurb", @"text", nil]];

    aboutData = [[NSMutableArray alloc] initWithObjects:aboutText, nil];
    [aboutText release];
}
my
HomeView
控制器调用控制器,即
aboutView

AboutViewTableController *aboutNavController = [[AboutViewTableController alloc] initWithNibName:@"AboutViewTableController" bundle:nil];
    aboutNavController.title = @"About One";

    // Create the nav controller and add the view controllers.
    UINavigationController *theNavController = [[UINavigationController alloc] initWithRootViewController:aboutNavController];

    // Display the nav controller modally.
    [self presentModalViewController: theNavController animated:YES]; <==== THIS IS WHERE IT FAILS
所以问题是,为什么它提出了一个例外,我一直在绞尽脑汁,尝试不同的途径,但都无济于事。 我也尝试过将aboutData作为保留集和非原子集的属性,但同样的问题也出现了。 我也很困惑,因为没有地方可以查询长度。
谢谢

嘿,我以前吃过这个。在某个地方执行此操作:[数组长度];但数组使用的是“计数”,而不是“长度”


有时会与它们的命名约定混淆,通常在OT

中,除了
createAboutData
中的内存泄漏之外,您在此处发布的代码不应导致错误。发布表视图数据源方法
numberOfSections
numberofrowsinssection
tableView:cellforrowatinexpath:
。这些都是可能出现错误的地方。我在代码中没有发现任何错误。您指出了错误发生的位置。我建议删除这一行中的空格presentModalViewController:theNavControllerIn要调试此错误,请查看发送给无法识别的选择器的对象的实例指针(它就在调试器的错误消息中),并查看该NSArray是否是您的(来自上面的代码),或者它是否是系统数组。这将帮助您缩小范围。
@interface AboutViewTableController : UITableViewController {
    NSMutableArray *aboutData;
    NSMutableArray *aboutSections;
}

-(void)createAboutData;
@end