OK, I want my game to pause if the player selects one of the other tabs.
Here's the code I tried...
first off, I made outlets for all the tabs and the tab bar those have all been connected in Interface Builder.
I've got this to set my controller object as the delegate of all the tabs:
There's an error for each one of the tab items...
I have tried commenting them out, and the compiler will run without errors, but it still doesn't work.
I also have:
In my header so that I wouldn't get the compiler error that I was missing the protocols.
And finally I have this:
I get the following warning here:
The NSLog message isn't ever posted meaning something prior to the code for pauseGame isn't working.
Here's the code I tried...
first off, I made outlets for all the tabs and the tab bar those have all been connected in Interface Builder.
Code:
IBOutlet UITabBar *tabBar;
IBOutlet UITabBarItem *optionsTab;
IBOutlet UITabBarItem *numbersTab;
IBOutlet UITabBarItem *scoresTab;
IBOutlet UITabBarItem *instructionsTab;
I've got this to set my controller object as the delegate of all the tabs:
Code:
- (void) awakeFromNib
{
tabBar.delegate = self;
optionsTab.delegate = self;
numbersTab.delegate = self;
scoresTab.delegate = self;
instructionsTab.delegate = self;
}
There's an error for each one of the tab items...
error: request for member 'delegate' in something not a structure or union
I have tried commenting them out, and the compiler will run without errors, but it still doesn't work.
I also have:
Code:
@interface Controller : NSObject <UITextFieldDelegate, [b]UITabBarDelegate[/b]>
In my header so that I wouldn't get the compiler error that I was missing the protocols.
And finally I have this:
Code:
- (void) tabBar: tabBar didSelectItem: tabItem
{
NSLog(@"Recognises that a tab item was selected.");
[self pauseGame];
}
warning: conflicting types for '-(void)tabBar: (id)tabBar didSelectItem: (id)tabItem'
The NSLog message isn't ever posted meaning something prior to the code for pauseGame isn't working.