objective c - iOS Link to external page -
having read this thread, i'm trying insert link external web page calling action upon touch inside
on button (button created in storyboard xcode 4.6).
this action:
-(ibaction)outlink:(id)sender { [[uiapplication sharedapplication] openurl:[nsurl urlwithstring: @"https://www.mysite.com/index.php"]]; }
and header file (.h
):
@interface menuviewcontroller : uiviewcontroller <uitableviewdatasource, uitabbarcontrollerdelegate>{ iboutlet uibutton *linktosite; } -(ibaction)outlink;
i have linked button element in storyboard, , i've linked action touch inside
event, error when click in simulator on button:
terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[menuviewcontroller outlink]: unrecognized selector sent instance 0x717d340'
change method name in .h class , reconnect outlet touchupinside event.
-(ibaction)outlink:(id)sender;
hope helps you.
Comments
Post a Comment