Next we wanted to include the GameFeed component, but only on the home screen. We used a similar approach to how we included AdMob in the free version. Some code snippets are included below to help others.
[sourcecode language="objc"]
-(id) init
{
if ( (self=[super init]) ) {
CGSize s = [[CCDirector sharedDirector] winSize];
controller = [[RootViewController alloc] init];
controller.view.frame = CGRectMake(0,0,s.width,s.height);
gameFeed = [OFGameFeedView gameFeedView];
[controller.view addSubview:gameFeed];
[[[CCDirector sharedDirector] openGLView]addSubview : controller.view];
}
return self;
}
- (void) dealloc
{
[controller.view removeFromSuperview];
[controller release];
[super dealloc];
}
[/sourcecode]
Do you know a different way to do it? Leave a comment below.