O'Reilly logo

Programming in Objective-C, Sixth Edition by Stephen G. Kochan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Defining the View Controller

Now, let’s write the code for the view controller class FCViewController. We start with the interface file Program 21.2.

Program 21.2 FCViewController.h Interface File

#import <UIKit/UIKit.h>@interface FCViewController : 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required