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

Reply
 
LinkBack Thread Tools Display Modes
Old 05-01-2011, 01:51 PM   #1 (permalink)
Registered Member
 
Join Date: May 2011
Posts: 1
littlemanapps is on a distinguished road
Exclamation How can i stop a -(void) method running?

ive added a pause function to my game, and if i 'restart' the game while it is running through the objects in an array to animate them, i receive exc_bad_access because its seems to continue running through the method it stopped on.

sorry if thats not clear.
littlemanapps is offline   Reply With Quote
Old 05-01-2011, 02:00 PM   #2 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

Instead of doing your way of pausing the game, look at this thread and implement my way. It will work for your problem.

Sorry: here is the link http://www.iphonedevsdk.com/forum/ip...terrupted.html
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 05-01-2011, 02:00 PM   #3 (permalink)
Indie Developer
 
iSDK's Avatar
 
Join Date: Jul 2010
Posts: 1,346
iSDK is on a distinguished road
Send a message via AIM to iSDK
Default

Set a bool which will tell you whether the app is running or not, and then have something like this:


Code:
- (void)restartGame {
if (gameIsRunning) {
[animations stopAnimating];
[game restart];
return;
}
else if (!gameIsRunning) {
[game restart];
return;
}
}
Quote:
Originally Posted by littlemanapps View Post
ive added a pause function to my game, and if i 'restart' the game while it is running through the objects in an array to animate them, i receive exc_bad_access because its seems to continue running through the method it stopped on.

sorry if thats not clear.
iSDK is offline   Reply With Quote
Reply

Bookmarks

Tags
animate, array, bad_access, method, stop

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: 339
11 members and 328 guests
dansparrow, iOS.Lover, lorrettaui53, MikaelBartlett, Nobbsy, oztemel, pbart, PlutoPrime, sledzeppelin, thephotographer, Trickphotostudios
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

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