开发者

How to call a function in one class from another class

开发者 https://www.devze.com 2023-02-28 02:21 出处:网络
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: seViewC

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

精彩评论

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