• 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: weak linking questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: weak linking questions


  • Subject: Re: weak linking questions
  • From: Fritz Anderson <email@hidden>
  • Date: Tue, 25 May 2004 19:08:23 -0500

Objective-C methods are accessed by (basically) a search of the class hierarchy, so there isn't a pointer to be NULL or otherwise. Even if it were a matter of a function pointer, why would you expect a call through a NULL function pointer to be benign?

The way you handle methods that may not be implemented is to test them in advance:

if ([myScrollView respondsToSelector: @selector(setAutohidesScrollers:)] {
[myScrollView setAutohidesScrollers: YES];
}


	-- F

On 25 May 2004, at 4:46 PM, Aurilien Hugeli wrote:

now i have
exception like this :
[NSScrollView setAutohidesScrollers:] selector not recognized... of
course i know it is panther only, but should n't it do nothing since
setAutohidesScrollers should be NULL because of weak linking ?
 --
Fritz Anderson
Consulting Programmer
http://resume.manoverboard.org/
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


References: 
 >weak linking questions (From: AurĂ©lien HugelĂ© <email@hidden>)

  • Prev by Date: Re: weak linking questions
  • Next by Date: Re: Controlling initialization order
  • Previous by thread: Re: weak linking questions
  • Next by thread: Project Naming Convention
  • Index(es):
    • Date
    • Thread