Reputation: 35
I am beginner of iPhone. I have create five button. button click event perform go to other class in that how to call button click event method..?
it is in ViewController class
(IBAction)onclickbutton1
{
}
(IBAction)onclickbutton2
{
}
and this onclickbutton1
and onclickbutton2
method how to call in other class in if condition
so, that condition of onclickbutton1
is true perform onclickbutton
event
Upvotes: 0
Views: 815
Reputation: 122458
Just add a test within the event handling methods:
- (IBAction)onclickbutton1
{
if (conditionIsTrue)
[OtherClass doThing1];
else
[OtherClass doThing2];
}
- (IBAction)onclickbutton2
{
if (conditionIsTrue)
[OtherClass doThing1];
else
[OtherClass doThing2];
}
Upvotes: 1