• 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: What does it mean when po puts % before class name?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What does it mean when po puts % before class name?


  • Subject: Re: What does it mean when po puts % before class name?
  • From: Ken Ferry <email@hidden>
  • Date: Fri, 30 Jul 2004 17:31:53 -0400

On Fri, 30 Jul 2004 17:17:33 -0400, Jim Correia <email@hidden> wrote:
>
> So if that is the case, then it is ill-adviced to pose as NSView if you
> do so at some random point in the applications lifetime after other
> NSViews have been created, because then you won't be able to identify
> them by type at runtime? (And therefor Apple's private class has a bug
> and my workaround is the right thing to do?)

> @implementation NSView(BugWorkaround)
>
> - (BOOL)isKindOfClass:(Class)aClass
> {
> if (aClass == [NSView class])
> {
> return YES;
> }
>
> return [super isKindOfClass: aClass];
> }

Actually, your workaround won't work. [NSView class] is going to
return what you think of as MyImposter, same problem.

You could try checking the interface instead of the class.

if ([object respondsToSelector:@selector(whateverICareAbout)])
{
...
}

-Ken
_______________________________________________
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: What does it mean when po puts % before class name?
      • From: Ken Ferry <email@hidden>
References: 
 >Re: What does it mean when po puts % before class name? (From: Greg Parker <email@hidden>)
 >Re: What does it mean when po puts % before class name? (From: Jim Correia <email@hidden>)
 >Re: What does it mean when po puts % before class name? (From: Jim Correia <email@hidden>)
 >Re: What does it mean when po puts % before class name? (From: Ken Ferry <email@hidden>)
 >Re: What does it mean when po puts % before class name? (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: What does it mean when po puts % before class name?
  • Next by Date: Cocoa/Obj-C Restart Computer
  • Previous by thread: Re: What does it mean when po puts % before class name?
  • Next by thread: Re: What does it mean when po puts % before class name?
  • Index(es):
    • Date
    • Thread