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];
...
精彩评论