开发者

How to call a function in one class from another class

I have a function insert in the seViewController.m. I want to call this from first.m. How can 开发者_JAVA百科i call this.


Create an instance of seViewController.m in first.m, by using the line: seViewController *seView = [[seViewController alloc] init]; (change options in init if needed).

Then, use [seView insert];


This is a very vague question about a very elementary topic. I seriously suggest reading a book about Objective-C programming.

That said, I can guess you need something like the following (in first.m):

#import "seViewController.h"
...
seViewController* seView = [seViewController new];
...
[seView insert];
...
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜