Re: What does it mean when po puts % before class name?
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.