lifemoveson
lifemoveson

Reputation: 1691

NSURLConnectionDelegate crashes on run

NSURLConnectionDelegate surely reduces the memory consumption and helps to parse the data very fast. I have used the logic from SeismicXML from Apple store and have used to parse the data. But my new concern is whenever I do "build and debug" my code, it runs fine. but when I run the application on its own it does not work. Does any one have any idea why it wont work when I run it on its own. I tried to use "build and analyze" my code but it did not show me any error on my memory management issues. I did look into the logs of the crash and here is what I receive:

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 + 

Upvotes: 0

Views: 259

Answers (3)

lifemoveson
lifemoveson

Reputation: 1691

 @Rog

Here is my code where I am using my UITableViewController and have released the allocated objects. Just FYI, I am using NSOperationQueue to parse my XML file and pull the data and parse it.

 @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];
   }

Upvotes: 0

Rog
Rog

Reputation: 18670

Most likely an issue with over releasing your tableview.

Are you using a UITableViewController? If so you should not be releasing the tableview yourself (and it looks like you are) otherwise check where you are alloc'ing/releasing it to make sure you are not calling release more than it is necessary.

Otherwise post your view controller interface declaration, as well as the code where you alloc/access your table view (likely to be your viewDidLoad) and your dealloc method.

Upvotes: 0

Max
Max

Reputation: 16719

This is not the issue with NSURLConnection. You're over-releasing some of your UI components (presumably some table or table cell).

Upvotes: 1

Related Questions