Re: Access Obj-C method/attribute from a C method
Re: Access Obj-C method/attribute from a C method
- Subject: Re: Access Obj-C method/attribute from a C method
- From: Scott Stevenson <email@hidden>
- Date: Sat, 7 Jul 2007 00:25:34 -0700
On Jul 7, 2007, at 12:13 AM, Eric MORAND wrote:
void ObjectAdded(void * refCon, io_iterator_t iterator)
{
// A lot of things are done...
[self addObjectToFooArray:anObject];
}
Unfortunately, it doesn't compile :
error: 'self' undeclared (first use in this function)
Is there a way to achieve what I need ?
Just pass in the object that you want to work with as an argument:
void ObjectAdded(void * refCon, io_iterator_t iterator, FooBar*
myObject)
{
// A lot of things are done...
[myObject addObjectToFooArray:anObject];
}
- Scott
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden