首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NSURLConnectionDelegate在运行时崩溃

NSURLConnectionDelegate在运行时崩溃
EN

Stack Overflow用户
提问于 2011-02-22 05:45:44
回答 3查看 249关注 0票数 0

NSURLConnectionDelegate确实减少了内存消耗,并有助于非常快速地解析数据。我使用了来自苹果商店的SeismicXML的逻辑,并用来解析数据。但我最关心的是,每当我“构建和调试”我的代码时,它都运行得很好。但是,当我单独运行应用程序时,它不能工作。有没有人知道为什么当我自己运行它的时候它不能工作。我试图使用“构建和分析”我的代码,但它没有显示任何关于我的内存管理问题的错误。我确实查看了崩溃的日志,下面是我收到的:

代码语言:javascript
复制
Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000007d89f87d
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Application Specific Information:
objc_msgSend() selector name: release
iPhone Simulator 235, iPhone OS 4.2 (iPhone/8C134)

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib                 0x01134a63 objc_msgSend + 23
1   UIKit                           0x004ab1e2 -[UITableViewCell removeFromSuperview] + 167
2   UIKit                           0x003249d9 -[UIView dealloc] + 340
3   UIKit                           0x0032e281 -[UIScrollView dealloc] + 341
4   UIKit                           0x003661ce -[UITableView dealloc] + 1085
5   CoreFoundation                  0x00ee9a6c CFRelease + 92
6   CoreFoundation                  0x00f0eb8d _CFAutoreleasePoolPop + 237
7   QuartzCore                      0x00d9a71c run_animation_callbacks(double, void*) + 359
8   QuartzCore                      0x00d9a589 CA::timer_callback(__CFRunLoopTimer*, void*) + 157
9   CoreFoundation                  0x00fb3fe3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
10  CoreFoundation                  0x00fb5594 __CFRunLoopDoTimer + 1220
11  CoreFoundation                  0x00f11cc9 __CFRunLoopRun + 1817
12  CoreFoundation                  0x00f11240 CFRunLoopRunSpecific + 208
13  CoreFoundation                  0x00f11161 CFRunLoopRunInMode + 97
14  GraphicsServices                0x01874268 GSEventRunModal + 217
15  GraphicsServices                0x0187432d GSEventRun + 115
16  UIKit                           0x002fa42e UIApplicationMain + 1160
17  Tab_Table_Win                   0x00001d7c main + 102 (main.m:14)
18  Tab_Table_Win                   0x00001d0d start + 53

Thread 1:  Dispatch queue: com.apple.libdispatch-manager
0   libSystem.B.dylib               0x94470982 kevent + 10
1   libSystem.B.dylib               0x9447109c _dispatch_mgr_invoke + 215
2   libSystem.B.dylib               0x94470559 _dispatch_queue_invoke + 
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2011-02-22 06:59:06

最有可能的问题是过度释放你的表视图。

你在用UITableViewController吗?如果是这样的话,你不应该自己释放这个表视图(看起来你是在释放它),否则检查你在哪里分配/释放它,以确保你没有调用超过必要的release。

否则,发布您的视图控制器接口声明,以及分配/访问表视图的代码(很可能是您的viewDidLoad)和dealloc方法。

票数 0
EN

Stack Overflow用户

发布于 2011-02-22 06:04:44

这不是NSURLConnection的问题所在。您过度释放了一些UI组件(可能是一些表或表单元格)。

票数 1
EN

Stack Overflow用户

发布于 2011-02-23 02:11:16

代码语言:javascript
复制
 @Rog

下面是我的代码,其中我使用了UITableViewController并释放了分配的对象。仅供参考,我使用NSOperationQueue来解析我的XML文件,并提取数据并解析它。

代码语言:javascript
复制
 @interface TableViewController : UITableViewController 
 {
  IBOutlet UITableView *eTableView;
  NSArray *cellNames;
  NSMutableArray *listArray;
  WinAppDelegate *appDelegate;

  }

  @property (nonatomic, retain) UITableView *eTableView;

  @property (nonatomic, retain) NSArray *cellNames;

  @property (nonatomic, retain) NSMutableArray *listArray;

  - (void)dealloc 
  {
  [cellNames release];
[eTableView release];
     [listArray release];
[super dealloc];
   }
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5071629

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档