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 06-08-2010, 10:02 PM   #1 (permalink)
Registered Member
 
Join Date: Nov 2009
Location: Orange County, California
Posts: 36
ShayansMind is on a distinguished road
Send a message via AIM to ShayansMind Send a message via Skype™ to ShayansMind
Default SubView Help!!!!

Hi, I have my code in my game...when someone pauses, in the pause menu the can go to the main menu (subview), from there they can play the game again, this used to work but now it takes you back to the pause menu when you click play. Please help me fix this
ShayansMind is offline   Reply With Quote
Old 06-08-2010, 10:23 PM   #2 (permalink)
Registered Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
smasher will become famous soon enough
Default

What's the code that brings up the pause menu? And the code that brings up the main menu? And the code for "play" too.
__________________

Free Games!
smasher is offline   Reply With Quote
Old 06-08-2010, 10:34 PM   #3 (permalink)
Registered Member
 
Join Date: Nov 2009
Location: Orange County, California
Posts: 36
ShayansMind is on a distinguished road
Send a message via AIM to ShayansMind Send a message via Skype™ to ShayansMind
Default the code...

Quote:
Originally Posted by smasher View Post
What's the code that brings up the pause menu? And the code that brings up the main menu? And the code for "play" too.
pause is

[self addSubviewause];
[randomMain invalidate];

main is

[pause addSubview:newmain];

play is

[newmain removeFromSuperview];
randomMain = [NSTimer scheduledTimerWithTimeInterval-1.0/-1.0) target:self selector:@selector(randomMainVoid) userInfo:nil repeats:YES];
ShayansMind is offline   Reply With Quote
Old 06-08-2010, 10:59 PM   #4 (permalink)
Registered Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
smasher will become famous soon enough
Default

It looks like you add the "pause" subview but you never remove it. Try this:

Code:
[pause removeFromSuperview];
//if main is a subview of pause, you probably don't need to remove it.
//[newmain removeFromSuperview];
randomMain = [NSTimer scheduledTimerWithTimeInterval-1.0/-1.0) target:self selector:@selector(randomMainVoid) userInfo:nil repeats:YES];
__________________

Free Games!
smasher is offline   Reply With Quote
Old 06-08-2010, 11:23 PM   #5 (permalink)
Registered Member
 
Join Date: Nov 2009
Location: Orange County, California
Posts: 36
ShayansMind is on a distinguished road
Send a message via AIM to ShayansMind Send a message via Skype™ to ShayansMind
Default wow...why didn't i i think of that

Quote:
Originally Posted by smasher View Post
It looks like you add the "pause" subview but you never remove it. Try this:

Code:
[pause removeFromSuperview];
//if main is a subview of pause, you probably don't need to remove it.
//[newmain removeFromSuperview];
randomMain = [NSTimer scheduledTimerWithTimeInterval-1.0/-1.0) target:self selector:@selector(randomMainVoid) userInfo:nil repeats:YES];
Thanks alot
I bought your game a little while ago, its fun
ShayansMind is offline   Reply With Quote
Reply

Bookmarks

Tags
code, removefromsuperview, subview, viewcontroller

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: 338
12 members and 326 guests
Absentia, Domele, fiftysixty, givensur, heshiming, iGamesDev, linkmx, michaelhansen, PixelInteractive, raihan.zbr, Sloshmonster
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,892
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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