Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bboyjayz

macrumors member
Original poster
Mar 20, 2009
55
0
Hi,
i've a problem, for my application, i want a view visible from all view which can appear during the game (yes my app is a game :) ), so, i've decided to put this view into the mainWindow... and it's work : the view appear all timeS... but their is a problem : if a clic on the view, it must open a url on safari, but it seems that a can't have an interaction with this view.... do you know how can i do ?
thank you for your answers...
 

BlackWolf

macrumors regular
Apr 9, 2009
244
0
Hi,
i've a problem, for my application, i want a view visible from all view which can appear during the game (yes my app is a game :) ), so, i've decided to put this view into the mainWindow... and it's work : the view appear all timeS... but their is a problem : if a clic on the view, it must open a url on safari, but it seems that a can't have an interaction with this view.... do you know how can i do ?
thank you for your answers...

well, like every other view you want to have interactions with. you subclass UIViewController and then use
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

or you use an IBAction and set it for "touch up inside" in that view.
 

bboyjayz

macrumors member
Original poster
Mar 20, 2009
55
0
Yes but it's not me who controll the interaction (it's a view for a advertisement)... :s
 

mccannmarc

macrumors 6502
Aug 15, 2008
270
0
Manchester, UK
well, like every other view you want to have interactions with. you subclass UIViewController and then use
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

or you use an IBAction and set it for "touch up inside" in that view.

You don't have to subclass UIViewController you can just subclass a UIView and override its touch methods

And to the OP, is the view a custom view class made by the advertising company? If so then something simple like not setting the user interaction enabled could be the issue. If it is in fact a class of your own then you will most certainly need to override the touch methods as BlackWolf said.
 

BlackWolf

macrumors regular
Apr 9, 2009
244
0
You don't have to subclass UIViewController you can just subclass a UIView and override its touch methods

And to the OP, is the view a custom view class made by the advertising company? If so then something simple like not setting the user interaction enabled could be the issue. If it is in fact a class of your own then you will most certainly need to override the touch methods as BlackWolf said.

yeah, but in my opinion you should always go with the controller classes if you have the chance to.
 

bboyjayz

macrumors member
Original poster
Mar 20, 2009
55
0
Sorry i think i'm lost, yes, the advertisement company gave me a personal viewController, so i don't really know how to manipulate this .... :s
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.