Quote:
Originally Posted by srikanth
Hi, I need to open a webpage when I touched a label in the coco2d layer. It should be opened by using safari. I am stuck at adding the view to the coco2d layer ? How can I resolve this ?
Thank you.
|
Hi there!
I think it's not possible to attach a UIWebView in Cocos2D (in fact I think Cocos2D and IB objects aren't good friends)...
Do you want to web page to be opened inside your app, or it is OK for you to close your app and open the safari app when the layer is touched? If the last one is what you're seeking this may help you:
Code:
// Put this in the action called when you touch the layer:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"http://www.google.com"]];
This will close your app an open the Safari app by the webpage.
Hope it helped!