First, you need to open the main.h
header file and make some changes to it. We dive here into Object-C/C++ code, so be confused if the code looks different from the native Monkey code:
1. Add an
import
statement for theMobFox/MobFox.h
file:#include <OpenAL/alc.h> #import <MobFox/MobFox.h> // ***** MonkeyView ***** @interface MonkeyView : UIView{
2. Next, add the
MobFoxBannerViewDelegate
to the Monkey view controller:// ***** MonkeyViewController ***** @interface MonkeyViewController : UIViewController <MobFoxBannerViewDelegate> { @public } @end
3. Next, we need to modify the
main.m
file, the heart of your Monkey code. Insert theviewDidLoad
method into theMonkeyViewController
implementation and call itssuper
implementation. Place the method right under theshouldAutorotateToInterfaceOrientation
method, which controls how the app will be able to rotate natively:@implementation MonkeyViewController -(BOOL)shouldAutorotateToInterfaceOrientation...