• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSURLConnection crashes with EXC_BAD_ADDRESS -- can't find why...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURLConnection crashes with EXC_BAD_ADDRESS -- can't find why...


  • Subject: Re: NSURLConnection crashes with EXC_BAD_ADDRESS -- can't find why...
  • From: david paeme <email@hidden>
  • Date: Fri, 10 Apr 2009 00:46:43 +0200

I guess I solved the problem:

I started thinking about why a locale would ever be needed - and all i could think of were strings and formatting. So I started fooling around with those... and the problem went away by using the userDefault differently: using a number (and %d) instead of a string (%@) the crashes went away....

NSString *urlString = [NSString stringWithFormat:@"%@?act=upd&lu= %@",WS_URL,[[NSUserDefaults standardUserDefaults] objectForKey:@"lastDbUpdate"]];

became

UInt lastupdate = [userDefaults integerForKey:@"lastDBUpdate"];
NSString *urlString = [NSString stringWithFormat:@"%@?act=upd&lu= %d",WS_URL,lastUpdated];


with lastUpdated now coming out of userDefaults as an int, and no longer as a string.



i still have no idea why that solved the problem - my hunch would be the string parsing in the NSURLConnection - as both strings should be quite equal, no?







On 09 Apr 2009, at 20:56, Greg Guerin wrote:

david paeme wrote:

This might be more interesting... looks like the thing some crash down in the bowels of LocaleGetValue?

Locale information is often taken from environment variables. Print the environment, compare it to when it doesn't crash, and check any differences.


Next, try running your code when logged in under a new user account. If it consistently works there, you may have a setting or a haxie of some kind in your original account that's breaking the code. If it fails on the new user account, it could still be a haxie or similar, but installed at the system-wide level, typically in /Library/.

Finally, you first wrote "very similar to what's in aaron hillegass' book". Have you tried the original code exactly as given in the book? Did it also fail, or did it work? If it also fails, that suggests something about your user account, environment, machine, configuration etc. If the original works, though, it suggests you've added a bug, so double-check every addition or deletion you made.

 -- GG

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: NSURLConnection crashes with EXC_BAD_ADDRESS -- can't find why... (From: Greg Guerin <email@hidden>)

  • Prev by Date: Re: Send click to window
  • Next by Date: Re: Change view on resize
  • Previous by thread: Re: NSURLConnection crashes with EXC_BAD_ADDRESS -- can't find why...
  • Next by thread: Re: NSURLConnection crashes with EXC_BAD_ADDRESS -- can't find why...
  • Index(es):
    • Date
    • Thread