• 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: Greg Parker <email@hidden>
  • Date: Fri, 30 Jul 2004 12:08:53 -0700

I'm debugging a uncaught exception, and I'm trying to examine objects
just before the point of failure. What does it mean when a % appears as
in the class name as a result of po?

(gdb) po $r5
<%NSView: 0xcca4f40>

This means some code somewhere has used +poseAsClass: to replace NSView with a custom implementation. The impostor class takes the name "NSView", and the priginal NSView gets the name "%NSView" and becomes the impostor's superclass.

Most likely, the object you're looking at was allocated before posing occurred. Existing instances of the original class are not re-assigned to the impostor class after posing, but new instances created afterwards will be of the impostor class.

Old class hierarchy:

"NSObject"
|
|
"NSView" (original)
|
|
"MyImpostor" (impostor)


Class hierarchy after [MyImpostor poseAsClass:NSView]:

"NSObject"
|
|
"%NSView" (original)
/ \
/ \
"NSView" (impostor) "MyImpostor" (copy of impostor)


--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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: Jim Correia <email@hidden>
  • Prev by Date: Re: Rendezvous Domain Question...
  • Next by Date: Equating pthreads_self() back to "info threads"?
  • 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