[[objc_class instance] testFunction:arg0 Arg1:arg1];
由于你没有提供进一步的信息:
objec_class是一个实例,你的单身?它处理消息实例? ...
或
objec_class真的是一类,具有类方法实例?这会给你另一个实例...
换句话说,你真的有这样的事
@interface class2 { } -(void) testFunction:(int)count Arg1:(const char *)args; @end
和
@include "class2.h" @interface objc_class { } -(class2*) instance { } -(void) testFunction:(int)count Arg1:(const char *)args; @end
或
@include "class2.h" @interface objc_class { } +(class2*) instance; // be aware of the fact, instance (normaly) does not have // access to any instance variables!
要包括在内吗?
你的代码看起来不像“嘿,对象(实例)单例,我告诉你'实例'。然后我接受你的回应并给它发送'testFunction:Arg1:'(带有一些值)“的消息!
(你确定你了解目标C?)
问候
你的意思是objective-c“方法”吗?我看不出你的代码有什么问题。你能提供更多细节吗? – yehnan 2010-08-07 00:13:38
@Gary,你知道怎么从C调用你的Objective-C单例吗? – user2924482 2016-09-09 23:42:23