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-19-2011, 11:39 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 2
PeteriPhoneNoob is on a distinguished road
Default pointer not working/not being accessed

Hello!

I'm trying to connect a pointer from one .m file to another but it doesn't seem to recoqnize it.

For example....

I'm trying to connect my a pointer from my main menu.m to my Game.m. it get's successfully build but it still doesn't seem to access that pointer.

What am I forgetting or doing wrong?

Thanks in advance!

MainMenu.h

Code:
BOOL NewGame;

@property (nonatomic) IBOutlet BOOL NewGame;

MainMenu.m

Code:
//Reset playerscore and gamestate
-(IBAction)NewGame{
	
         NewGame = YES; //Should be recognized from the Game.m file
	[audio stop];
	audio.numberOfLoops = 0;
	[audio release];
	NSLog(@"New");
	back.hidden = YES;
	newgame.hidden = YES;
	continuegame.hidden = YES;
	korridor1.hidden = NO;
	fackla.hidden = YES;
	Start.hidden = YES;
	option.hidden = YES;
	howtoplay.hidden = YES;
	SFXimage.hidden = YES; 
	Musicimage.hidden = YES;  
	[UIView beginAnimations:@"korridor_1.png" context:nil];
	[UIView setAnimationDuration:1];
	korridor1.transform = CGAffineTransformMakeScale(13,13);
	korridor1.alpha = 1.0f;
	[UIView commitAnimations];
	
	
	//The Game begins
	[NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector:@selector(GameView) userInfo:nil repeats:NO];
	
}
game.h
Code:
#import "MainMenu.h"

@class MainMenu;

//Pointer to the MainMenu
MainMenu *mainmenu;

@property (nonatomic, retain) IBOutlet MainMenu *mainmenu;
game.m

Code:
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
	
	if(mainmenu.NewGame == YES){ //this doesn't get recognized
	
	//The game starts after 8 sec
	timer = [NSTimer scheduledTimerWithTimeInterval:8 target:self selector:@selector(StartGame) userInfo:nil repeats:NO];
	}

       else{
       NSlog(@"resume");
}
}

Last edited by PeteriPhoneNoob; 07-20-2011 at 02:40 AM.
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: 412
10 members and 402 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