开发者

passing variables

开发者 https://www.devze.com 2023-01-18 01:31 出处:网络
Ok here is an example of what I\'m dealing with at the moment: @implementation ECHOAppDelegate ... @end

Ok here is an example of what I'm dealing with at the moment:

@implementation ECHOAppDelegate
 ...
 @end

 @interface PtyView (PtyPrivate)
 -(void)startTask;
 -(void) didRead: (NSNotification *)fileNoty;
 @end

 @implementation PtyView
 ...
 -(void)startTask {
 //starts task
 }
 @end

Now, if I wanted to "trigger" startTask from the ECHOAppDelegate implementation, how would I do th开发者_运维百科at? Now, it says that it wasn't declared.


First, make sure you import the PtyView header. In ECHOAppDelegate.m:

#import "PtyView.h"

Then, assuming you have an instance of PtyView:

[myPtyViewObj startTask];
0

精彩评论

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