Re: Use of Mac OS X 10.5 / Leopards Garbage Collection Considered Harmful
Re: Use of Mac OS X 10.5 / Leopards Garbage Collection Considered Harmful
- Subject: Re: Use of Mac OS X 10.5 / Leopards Garbage Collection Considered Harmful
- From: Jean-Daniel Dupas <email@hidden>
- Date: Wed, 6 Feb 2008 18:05:46 +0100
Structures don't have "magic invisible members":
@interface Foo {
}
@end
Foo *aFoo;
NSLog(@"Foo is a %@", aFoo->isa);
Notice how there is an "isa" member that is automatically put there,
not unlike the way that a C++ object might have a vtable (or other
internal plumbing for multiple inheritance).
Wrong. This will not work. Foo will not have a magic isa ivar, an is
not a valid objc class.
You have to either:
1) inherit from a valid root class (NSObject).
2) add a "Class isa" ivar to your declaration.
See the NSObject declaration:
@interface NSObject <NSObject> {
Class isa;
}
...
@end
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden