【发布时间】:2012-06-01 21:17:57
【问题描述】:
XML 解析器正在尝试分配其委托的 NSMutable 数组,名为 masterCodeList。从下面的代码中,你会看到这失败了。 (我完全是新手。)
if (dataController.masterCodeList == nil){
dataController.masterCodeList =[[NSMutableArray alloc] init];
if (dataController.masterCodeList == nil) {
NSLog(@"the init of the mutable array did NOT work");
}
}
我每次都会收到the init of the mutable array did NOT work 消息。我正在导入 dataController 标头。
#import "CodeDataController.h"
我没有收到其他错误消息,解析器解析正常,应用程序运行平稳,没有内容。
提前致谢。
【问题讨论】:
-
您在使用 ARC 吗?您的 dataController 对象中如何定义“
masterCodeList”? -
dataController 是空的吗?
-
另外,为什么您的较低级别(子)XML 解析器试图分配您的委托(可能是父母的“masterCodeList”。为什么委托自己不这样做?
-
我在解析器的接口中声明了 CodeDataController *dataController。够了吗?
-
dataController 为空!我该怎么办?
标签: ios xcode nsmutablearray alloc