• 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
is protected broken, or am I?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Progress Indicator problem
  • Next by Date: NSImage leaks on every draw?! Help!
  • Previous by thread: Re: is protected broken, or am I?
  • Next by thread: Help - Newbie Drag And Drop Question (again)
  • Index(es):
    • Date
    • Thread