• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Access Obj-C method/attribute from a C method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Access Obj-C method/attribute from a C method
      • From: Eric MORAND <email@hidden>
References: 
 >Access Obj-C method/attribute from a C method (From: Eric MORAND <email@hidden>)

  • Prev by Date: Re: Mounting Local Volumes
  • Next by Date: Re: Access Obj-C method/attribute from a C method
  • Previous by thread: Access Obj-C method/attribute from a C method
  • Next by thread: Re: Access Obj-C method/attribute from a C method
  • Index(es):
    • Date
    • Thread