• 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: Objective-C question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C question


  • Subject: Re: Objective-C question
  • From: Scott Thompson <email@hidden>
  • Date: Tue, 4 May 2004 19:19:43 -0500

On May 4, 2004, at 12:57 PM, j o a r wrote:

Eh, no - you can't access instance variables from a C function - unless
you pass them to the function as parameters. This is especially
important for the reference to "self", that you need to be able to call
instance methods.

That's not entirely true. I mean, if I write a C function and pass it a pointer to an Objective-C object then I can access the instance variables of the object:

void MyCFunction(ObjectiveCClassWithInstanceVariables *someObject)
{
int fred = someObject->anInstanceVariable;
}

There should be nothing wrong with that.

Scott
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Objective-C question
      • From: Ondra Cada <email@hidden>
References: 
 >Objective-C question (From: Chuck Soper <email@hidden>)
 >Re: Objective-C question (From: Fritz Anderson <email@hidden>)
 >Re: Objective-C question (From: Chuck Soper <email@hidden>)
 >Re: Objective-C question (From: j o a r <email@hidden>)

  • Prev by Date: Is NSAppleScript thread-safe?
  • Next by Date: Re: Objective-C question
  • Previous by thread: Re: Objective-C question
  • Next by thread: Re: Objective-C question
  • Index(es):
    • Date
    • Thread