i am developing a small game in which i am integrating ads in a UIWebview. Since a UIKit object i am having difficulties in adding it to a Cocos2d layer. its simple enough to add it to one layer but the Webview takes time to load. Meanwhile as i move to some other class the UIWebview loads and gets added to that particular CCLayer class,to remove them in the very same class i use
[webViewH stopLoading];
[webViewF stopLoading];
webViewF.hidden=YES;
webViewH.hidden=YES;
[webViewH removeFromSuperview];
[webViewF removeFromSuperview];
but my app gets killed as soon as i move to the other class giving error with NSZombieEnabled — Webview:didCommitLoadForFrame or sometimes Webview:didclearwindowObject. i guess its still loading in the previous class while i have removed it from superview so app gets killed?? what am i possibly doing wrong??
I recently added a UIWebView to my cocos2d game using a class posted on the cocos2d forum. It’s called CCUIViewWrapper and as its name suggests is a CCNode object that wraps any UIView control. Pretty neat.
See more at here:
http://www.cocos2d-iphone.org/forum/tags/ccuiviewwrapper