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 ...

Get Programming in Objective-C, Sixth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.