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 Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-22-2011, 07:32 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 2
PeteriPhoneNoob is on a distinguished road
Default switching between multiple views

Hello!

I've been trying to connect two xib files via their .m files but it seems that the BOOL values on one .m file doesn't respond when accessed from the other .m file

In this case I try to enable a button in the menu.m when the button end is pressed on the game.m but the BOOL value doesn't respond

this is how I did the code...

am I forgetting something?

menu.h

Code:
#import "Game.h"

@class Game;

//Pointer to the gameview
IBOutlet Game *game;

@property (nonatomic, retain) IBOutlet Game *game;
menu.m

Code:
@synthesize game:

-(IBAction)start{
	
	NSLog(@"Start");
	
	game = [[Game alloc] initWithNibName:@"Game" bundle: nil];
	
        //this button shall be enabled when  MSaveToContinue == YES
	if(game.MSaveToContinue == YES){ //this button shall be enabled when
		
		NSLog(@"game.MSaveToContinue == YES");
		continuegame.hidden = NO;
		continuegame.alpha = 1.0;
		continuegame.enabled = YES;
	}
	else{
		NSLog(@"game.MSaveToContinue == NO");
		continuegame.hidden = NO;
		continuegame.alpha = 0.5;
		continuegame.enabled = NO;
	}

	back.hidden = NO;
	
}
game.h

Code:
BOOL MSaveToContinue;

@property (nonatomic) IBOutlet BOOL MSaveToContinue;
game.m

Code:
@synthesize MSaveToContinue;

//Saving the current gamestate
-(void)saveGameState {
	
	MSaveToContinue == YES; 
	
}

-(IBAction)endGame{

 [self saveGameState];
}
is there another way to switch between xibs?

maybe an easier way...

from one .m file perhaps? if yes then how ?

thanks in advance
PeteriPhoneNoob 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: 410
10 members and 400 guests
AppleDev, chemistry, Emy, hussain1982, ipodphone, mistergreen2011, pipposanta, Retouchable, skrew88, SLIC
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,679
Threads: 94,128
Posts: 402,923
Top Poster: BrianSlick (7,990)
Welcome to our newest member, xzoonxoom
Powered by vBadvanced CMPS v3.1.0

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