Question

I tried doing this in my objective C method

my_function(self);

my_function(void *param)
{

id self = param;
[self.Output insertText:@"Hello world"];

}

Output is of type NSTextView.

I get the following errors in compilation

Use of undeclared identifier 'id' in the line  "id self = param". 

I tried #import <Cocoa/Cocoa.h>, but didn't help. In the line [self.Output insertText:@"Hello world"];, I get "Expected expression" error.

Basically, what i am trying to do is to share some data periodically between my c function(where it's generated) and objective c method(where it's processed and displayed). I am total newbie in objective c, any help is greatly appreciated. If there is a better way to do this than calling objective c methods from C function, I am open to that.

Était-ce utile?

La solution

You can not use objektive-c in .c files. But you can use c in .m files so if you need to mix make sure its a .m file.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top