开发者

Creating a function and calling it from a UIButton connected to an IBAction?

I have an iPhone app called i4MMS it is published in Cydia. I'm really a noob with this but I wanted to find a way to create a function or method and then call it using IBAction. Would it be like this?

+ (void) myMethod {
NSLog(@"Step 1");
NSLog(@"Step 2");
}

[myBu开发者_JAVA技巧tton addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];

- (IBAction)buttonClicked:(id)sender{
myMethod
}


change myMethod in your IBAction method to [<insert name of class here> myMethod];

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜