December 2012
Beginner
552 pages
12h 58m
English
Now, let’s write the code for the view controller class ViewController. We start with the interface file Program 21.2.
Program 21.2. ViewController.h Interface File
#import <UIKit/UIKit.h>@interface ViewController : UIViewController@property (strong, nonatomic) IBOutlet UILabel *display;-(void) processDigit: (int) digit;-(void) processOp: (char) theOp;-(void) storeFracPart;// Numeric keys-(IBAction) clickDigit: (UIButton *) sender;// Arithmetic Operation keys-(IBAction) clickPlus;-(IBAction) clickMinus;-(IBAction) clickMultiply;-(IBAction) clickDivide;// Misc. Keys-(IBAction) clickOver;-(IBAction) clickEquals;-(IBAction) clickClear;@end
There are housekeeping variables for building the fractions (currentNumber
Read now
Unlock full access