Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 07-02-2010, 02:28 PM   #1 (permalink)
Registered Member
 
Join Date: Dec 2009
Location: Benicia, CA
Age: 50
Posts: 152
That Don Guy is on a distinguished road
Default NSAutoreleasePool crashes in 4.0 Simulator but not 3.2

I have an app that runs fine when compiled and run on the 3.2 Simulator using XCode 3.2.3, but on the 4.0 Simulator, when I try to allocate and initialize an NSAutoreleasePool as part of a background loop, it stops with a SIGABRT exception.

The code that starts the background loop is:
Code:
[NSThread detachNewThreadSelector:@selector(checkNumber) toTarget:self withObject:nil];
and the first line of checkNumber (the point where it crashes - a breakpoint set here stops successfully, but any sort of "step" throws the exception) is:
Code:
NSAutoreleasePool *pool = [[NSAutoreleasePool init] alloc];
Any reason why this is happening? Am I missing something with the project settings?

-- Don
That Don Guy is offline   Reply With Quote
Old 07-02-2010, 02:52 PM   #2 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 580
ChrisL is on a distinguished road
Default

Just a typo:
Code:
[[NSAutoreleasePool init] alloc]
should be
Code:
[[NSAutoreleasePool alloc] init]
ChrisL is offline   Reply With Quote
Old 07-02-2010, 02:58 PM   #3 (permalink)
Registered Member
 
Join Date: Dec 2009
Location: Benicia, CA
Age: 50
Posts: 152
That Don Guy is on a distinguished road
Default

Actually, having init before alloc is how it appeared in the code (and why the compiler let it through and 3.2 let it run, I don't know) - fixing it solved the problem.

-- Don
That Don Guy is offline   Reply With Quote
Old 07-02-2010, 03:03 PM   #4 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 580
ChrisL is on a distinguished road
Default

Quote:
Originally Posted by That Don Guy View Post
Actually, having init before alloc is how it appeared in the code (and why the compiler let it through and 3.2 let it run, I don't know) - fixing it solved the problem.

-- Don
Yes, sorry, I meant that the bug was probably just a typo in the code (I wasn't referring to your post itself). No idea why it previously worked, but glad it's fixed now.
ChrisL is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 380
10 members and 370 guests
.Snipe, AragornSG, baja_yu, ChrisYates, davejas69, guusleijsten, hussain1982, Kryckter, locombiano89, stanny
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,646
Threads: 94,111
Posts: 402,862
Top Poster: BrianSlick (7,990)
Welcome to our newest member, locombiano89
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:38 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0