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

Re: OBJ-C question


  • Subject: Re: OBJ-C question
  • From: Ondra Cada <email@hidden>
  • Date: Sat, 17 Apr 2004 20:26:53 +0200

On 17.4.2004, at 19:55, Kay Roepke wrote:

>> There's also efficiency to consider - without a default
>> implementation, you have to call respondsToSelector: before each call
>> to a data source method....
>
> A pattern I've seen quite often in Apple's headers (I think it was in
> Xcode class-dumps. Not too sure anymore where it was...) is
> to have a struct in which the result of respondsToSelector: (i.e.
> YES/NO) is saved.

Actually I believe the trick often is more subtle, namely that they
cache IMPs at setDelegate: (setDataSource:, etc) time. I have never
tested it myself (!), but I guess they simply let you dry if you tried
things like loading the appropriate bundle AFTER setting the data
source/delegate:

>> You couldn't simply call it in setDataSource: because the method
>> could be added to the class after the data source object has been
>> assigned.

In other words, this just won't work for a vast majority of delegates
and similar relationships (or so I think, no guarantee worldwide ;)
---
Ondra Hada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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: OBJ-C question
      • From: John Randolph <email@hidden>
References: 
 >OBJ-C question (From: "Mike R. Manzano" <email@hidden>)
 >Re: OBJ-C question (From: Ondra Cada <email@hidden>)
 >Re: OBJ-C question (From: "Mike R. Manzano" <email@hidden>)
 >Re: OBJ-C question (From: Ondra Cada <email@hidden>)
 >Re: OBJ-C question (From: Sherm Pendley <email@hidden>)
 >Re: OBJ-C question (From: Ondra Cada <email@hidden>)
 >Re: OBJ-C question (From: Sherm Pendley <email@hidden>)
 >Re: OBJ-C question (From: Kay Roepke <email@hidden>)

  • Prev by Date: Re: File size of a downloadable file
  • Next by Date: Re: File size of a downloadable file
  • Previous by thread: Re: OBJ-C question
  • Next by thread: Re: OBJ-C question
  • Index(es):
    • Date
    • Thread