Quote:
Originally Posted by sunnyli
Nice code, does anyone know how you would center the puzzle in the middle of the view?
|
Hi,
Im trying to implement a menu on this slider puzzle, but not having any luck. Ive added in the appdelegate:
Code:
self.mainMenuViewController = [[MainMenuViewController alloc] init];
[window addSubview:mainMenuViewController.view];
[window makeKeyAndVisible];
To load the main menu
And in the main menu:
Code:
#import <UIKit/UIKit.h>
#import "SliderController.h"
@interface MainMenuViewController : UIViewController {
IBOutlet UIButton *start;
}
@property (retain, nonatomic) UIButton *start;
- (IBAction)buttonPressed;
@end
Code:
@implementation MainMenuViewController
@synthesize start;
- (IBAction)buttonPressed{
SliderController *gameview = [[SliderController alloc] initWithNibName:nil bundle:nil];
gameview.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:gameview animated:YES];
}
But it just crashes, the debugger says the error is on:
Code:
SliderController *gameview = [[SliderController alloc] initWithNibName:nil bundle:nil];
Any help at all?