• 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: Observed behaviour - Is this expected
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Observed behaviour - Is this expected


  • Subject: Re: Observed behaviour - Is this expected
  • From: David Blanton <email@hidden>
  • Date: Mon, 25 Jan 2010 21:08:33 -0700


On Jan 25, 2010, at 8:51 PM, Kyle Sluder wrote:

On Mon, Jan 25, 2010 at 7:43 PM, David Blanton <email@hidden> wrote:
Class A is a subclass of NSView
Class B is a subclass of Class A

Class A and Class B are in a NIB.

Classes don't live in nibs. You mean an object of class A and an object of class B live in the nib.

Class A as an Object - the blue cube
Class B as a view in a window.

So your instance of A and your instance of B are entirely unrelated.

Well, dosen't

@interface ClassB : ClassA

say they are related?




When the program runs:

Class A's init method is called
Class B's awakeFromNib is called
Class A's awakeFromNib is called

Class B will have been initialized with -initWithFrame:, as documented in the Resource Programming Guide: http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html


I have a breakpoint on Class B's initWithFrame and it is never hit ...

@implementation ClassB

- (id) initWithFrame:(NSRect)frame
{
	self = [super initWithFrame:frame];
	if (self != nil)
	{

	}
	return self;
}


As the documentation explains, your instance of class A is encoded as
an object placeholder, whereas your instance of class B has been
encoded as a custom view placeholder.

--Kyle Sluder



_______________________________________________

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


References: 
 >Observed behaviour - Is this expected (From: David Blanton <email@hidden>)
 >Re: Observed behaviour - Is this expected (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Observed behaviour - Is this expected
  • Next by Date: Re: Observed behaviour - Is this expected
  • Previous by thread: Re: Observed behaviour - Is this expected
  • Next by thread: Re: Observed behaviour - Is this expected
  • Index(es):
    • Date
    • Thread