At least for now. I need some more text for the instructions, and I am having trouble when switching from the landscape orientation in the main window and the portrait orientation in the flipside view, but that will be fixed soon. Here are some images of the flipside:

As you can see, the instructions are not helpful. Here is the About box:

This box contains enough text to require a scrolling box.
//
// FlipsideViewController.h
// imGravityGame
//
// Created by John Ahrens on 1/9/09.
// Copyright John Ahrens, LLC 2009. All rights reserved.
//
#import
@class AppController;
@interface FlipsideViewController : UIViewController
{
IBOutlet UIPickerView *planetView;
IBOutlet UISlider *slider;
IBOutlet UILabel *sliderLabel;
IBOutlet UIButton *instructionsButton;
IBOutlet UIButton *aboutButton;
AppController *controller;
NSArray *planets;
}
@property (nonatomic, retain)UIPickerView *planetView;
@property (nonatomic, retain)UISlider *slider;
@property (nonatomic, retain)UILabel *sliderLabel;
@property (nonatomic, retain)UIButton *instructionsButton;
@property (nonatomic, retain)UIButton *aboutButton;
@property (nonatomic, retain)AppController *controller;
@property (nonatomic, retain)NSArray *planets;
- (IBAction)sliderChanged: (id)sender;
- (IBAction)buttonPressed: (id)sender;
@end
Also of interest at this time is the -(IBAction)buttonPressed: (id)sender method:
- (IBAction)buttonPressed: (id)sender
{
NSString *title = [sender currentTitle];
NSBundle *bundle = [NSBundle mainBundle];
NSString *file;
if ([title hasPrefix: @"About"])
{
// This is the About button
file = [bundle pathForResource: @"about" ofType: @"txt"];
}
else
{
// This is the Instructions button
file = [bundle pathForResource: @"instructions" ofType: @"txt"];
}
NSString *text = [NSString stringWithContentsOfFile: file
encoding: NSUTF8StringEncoding
error:nil];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle: title
message: text
delegate: nil
cancelButtonTitle: @"Close"
otherButtonTitles: nil];
[alert show];
[alert release];
}
Note that it determines which button was pressed, then gets the appropriate file and opens the alert box. The message in the alert box is the contents of the file.
Technorati Tags:
Development, imGravityGame, iPhone