is protected broken, or am I?
is protected broken, or am I?
- Subject: is protected broken, or am I?
- From: matt neuburg <email@hidden>
- Date: Sat, 26 Oct 2002 08:21:13 -0700
On Wed, 23 Oct 2002 20:19:15 -0600, Mike Shields <email@hidden> said:
>
// Assuming you have written a class similar to the Sibling class in
>
the ObjC programming book.
>
>
@interface Sister : Sibling
>
@end
>
>
@implementation Sister
>
>
// This method DOES compile
>
- makePrettyFraternalSister
>
{
>
Sister* sister = [[Sister alloc] init];
>
sister->gender = 1;
>
return sister;
>
}
This is just what I needed - casting the MyBaseClass instance down to a MySubClass allows another MySubClass instance to peek inside it and see its protected ivars. Thx! m.
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
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.