• 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: Accessing Cocoa instance variables from C functions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing Cocoa instance variables from C functions


  • Subject: Re: Accessing Cocoa instance variables from C functions
  • From: Ondra Cada <email@hidden>
  • Date: Mon, 24 Apr 2006 18:43:39 +0200

William,

On Apr 24, 2006, at 5:19 PM, William Bumgarner wrote:

Given that you wrote the C library, I would suggest adding a (void *) context argument to your API. Easy & straightforward. Works regardless of single window vs. document based and your library will remain portable as it does not introduce any Objective-C'isms into the library.

It somewhat depends though -- since the implementation is ObjC-based anyway, it might be better to publish the fact (and make the compiler check for typos etc.) by declaring the argument an id, or, better, WhateverClass*.


I would even argue this is much more often case than those when hiding an object under a void* is beneficial :)
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Accessing Cocoa instance variables from C functions
      • From: William Bumgarner <email@hidden>
References: 
 >Accessing Cocoa instance variables from C functions (From: Damien Sorresso <email@hidden>)
 >Re: Accessing Cocoa instance variables from C functions (From: William Bumgarner <email@hidden>)

  • Prev by Date: Re: Accessing Cocoa instance variables from C functions
  • Next by Date: Frameworks, I need to make one...
  • Previous by thread: Re: Accessing Cocoa instance variables from C functions
  • Next by thread: Re: Accessing Cocoa instance variables from C functions
  • Index(es):
    • Date
    • Thread