Hello people,
starting to get my head around cocosLive and the way to display it with a UITableView (any better ideas?). Anyways, I discovered the UIKitLayer and decided to give it a go.
Quite a few problems popped up when trying to integrate UIKitLayer:
1) No CocosNode transitions.
2) Cleanup of the UIKitLayer takes quite long, and if I try to remove it from the scene of the layer - no touches are recognized.
3) Any way to remove UIKitLayer in a better way? ([self->pView removeFromSuperView] causes problems)
Here's some code:
- (id)init {
self = [super init];
_table = [[UITableViewController alloc] initWithStyle:UITableViewStylePlain];
//[_table.tableView setDataSource:self];
//[_table.tableView setDelegate:self];
[_table setTitle:@"HighScores"];
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(back:)];
_table.navigationItem.leftBarButtonItem = item;
[item release];
nav.navigationItem.leftBarButtonItem = item;
nav = [[UINavigationController alloc] initWithRootViewController:_table];
[nav.navigationBar setFrame:CGRectMake(0.0, 0.0, 320.0, 70.0)];
[self addChild:nav.view];
return self;
}
- (void)back:(id)sender {
[self->pView removeFromSuperview];
[self removeAllChildrenWithCleanup:YES];
[[Director sharedDirector] replaceScene:[MainScene node]];
}
- (void)dealloc {
[_table.view removeFromSuperview];
[_table release];
[nav.view removeFromSuperview];
[nav release];
[super dealloc];
}
@end
Tried implementing with a scene too, but UIKitLayer has alot of issues.
If I'll have anymore questions, I'll be sure to post 'em.