Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6795381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:20:17+00:00 2026-05-26T18:20:17+00:00

I have been getting errors while NSURLConnection delegate method connectionDidFinishLoading executes. Interestingly it works

  • 0

I have been getting errors while NSURLConnection delegate method connectionDidFinishLoading executes. Interestingly it works on simulator but it crashes on physical device. More interestingly it crashes only when this sequence of operation is done,

  • Run App
  • Shows Tweet! (Awesome)
  • Press Home button
  • Double click Home button
  • Force quit app
  • Again open app
  • CRASHED!!!!! ( 🙁 )…Keep crashing until you restart your phone!

ERROR LOG :

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xa0000008
Crashed Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x321befbc 0x321bb000 + 16316
1   Tittle-Tattle                   0x0002cf10 -[MapViewController connectionDidFinishLoading:] (MapViewController.m:108)
2   Foundation                      0x3316bc32 0x330a5000 + 814130
3   Foundation                      0x330c36e2 0x330a5000 + 124642
4   Foundation                      0x330c36ac 0x330a5000 + 124588
5   Foundation                      0x330c35ce 0x330a5000 + 124366
6   CFNetwork                       0x35e7689e 0x35e67000 + 63646
7   CFNetwork                       0x35e6b53e 0x35e67000 + 17726
8   CFNetwork                       0x35e6b632 0x35e67000 + 17970
9   CFNetwork                       0x35e6b23c 0x35e67000 + 16956
10  CFNetwork                       0x35e6b172 0x35e67000 + 16754
11  CoreFoundation                  0x34176afc 0x340e9000 + 580348
12  CoreFoundation                  0x341762c8 0x340e9000 + 578248
13  CoreFoundation                  0x3417506e 0x340e9000 + 573550
14  CoreFoundation                  0x340f84d6 0x340e9000 + 62678
15  CoreFoundation                  0x340f839e 0x340e9000 + 62366
16  GraphicsServices                0x3254dfc6 0x3254a000 + 16326
17  UIKit                           0x3734e73c 0x3731d000 + 202556
18  Tittle-Tattle                   0x000200e0 main (main.m:16)
19  Tittle-Tattle                   0x00020084 start + 32

CODE :

- (void)connectionDidFinishLoading:(NSURLConnection *)connection {

    [urlConnection cancel];
    [urlConnection release];
    NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];

    //Since we got new fresh data we shall put it in LatestLocationData entity in CoreData
    [self insertLastKnownLocationDataIntoCoreDataWith:responseString];

    //Test purpose only, See what we have got in CoreData
    [self fetchLastKnownLocationDataFromCoreData];

    NSDictionary *results = [responseString JSONValue];
    placesNearBy = [results objectForKey:@"results"];

    [responseString release];

    [self dropNearByPlacesAnnotationsFrom:placesNearBy];

}

Question : What could be the possible reason for this?

Similar Question(Not by me!) previously asked but no one replied on that question : Application not running in iOS 5


My understanding so far is, EXE_BAD_ACCESS only happens when you try to access memory address which hasn’t been allocated, Or previously allocated but now it’s been released.

EDIT AFTER RESPONSE IN COMMENT :

Hey Firoze, This is how I am init NSURLConnection

urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:20:18+00:00Added an answer on May 26, 2026 at 6:20 pm

    Looking at your comments I would suggest you use @property declarations for all of your ivars. They will alleviate all of the manual memory management you are having to do, which is probably where your problem lies.

    Quick example

    YourClass.h

    @interface YourClass
    @property (nonatomic, retain) NSURLConnection *urlConnection;
    // More ivars
    
    // Method declations
    @end
    

    YourClass.m

    @interface YourClass
    
    @synthesize urlConnection = _urlConnection;
    
    // The method where you instantiate urlConnection
    {
        NSURLConnection *urlConnection = [[NSURLConnection alloc] initWithRequest:request
                                                                         delegate:self];
        self.urlConnection = urlConnection;
        [urlConnection release]; urlConnection = nil;
    
        // Do whatever else you do here
    }
    
    - (void)connectionDidFinishLoading:(NSURLConnection *)connection 
    {
        [self.urlConnection cancel];
        self.urlConnection = nil;     <- This takes care of releasing the ivar and setting it to nil so there is no dangerous hanging pointer
    
        // ... the rest of your method
    }
    
    [urlConnection cancel];
    [urlConnection release];
    // You need to clean up after yourself with any ivars you make
    - (void)dealloc
    {
        [_urlConnection release]; 
        // Release any other ivars
        [super dealloc];
    }
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On several of my adsense running sites, I have been getting the following errors:
I keep getting errors that my functions have been defined multiple times. Of course
I have been using Visual Studio 2008 quite long but lately I am getting
I am trying to validate weather the connection was successful but have been getting
I have been trying to install the Ruby PG gem, but kept getting the
I've been working on this Solution for a while now, but suddenly I'm getting
I have been getting an error in VB .Net object reference not set to
I have been getting a number of attacks on my website lately, with a
I have just been getting into low level programming (reading/writing to memory that sort
I use an sql server regularly and have recently been getting frustrated by the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.