我的iPhone应用程序第一次崩溃,我打开该项目
答
你有记忆问题,试图在你的GetXML
类来访问一个释放NSURL
... 有:
- (void)main {
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
>> NSData *xml = [NSData dataWithContentsOfURL:url];
...
诊断这些,利用NSZombiesEnabled,explained there。
要解决你的崩溃,请确保您retain
或copy
您的网址您的getXML类:
- (id)initWithURL:(NSURL*)newURL delegate:(id <GetXMLDelegate>)newDelegate
{
self = [super init];
url = [newURL copy]; // there
delegate = newDelegate;
return self;
}
,避免内存泄漏,请确保您的发行版,网址
- (void)dealloc {
[url release];
[super dealloc];
}
未测试代码,但应该工作...您应该重新读取Apple documentation about memory management ...;)
您可以发布崩溃报告吗? – mmccomb 2011-04-03 13:51:06