Re: Multiple Observations
Re: Multiple Observations
- Subject: Re: Multiple Observations
- From: Ken Thomases <email@hidden>
- Date: Sat, 15 Jun 2013 11:15:01 -0500
On Jun 15, 2013, at 10:54 AM, Gordon Apple wrote:
> On 6/15/13 10:19 AM, "Kyle Sluder" <email@hidden> wrote:
>
>> On Jun 15, 2013, at 8:08 AM, Gordon Apple <email@hidden> wrote:
>>
>>>> OMG! I thought for sure I had checked awakeFromNib. That is the problem.
>>>> My view-based outline view has issues. makeViewWithIdentifier:owner: is
>>>> causing the owner¹s awakeFromNib to get called each time. It looks like I
>>>> have run into another bug in view-based outlineViews. Bug report time. I¹m
>>>> going to have to figure out how to get around this. Maybe set a flag to
>>>> insure awakeFromNib only gets called once.
>>
>> This is not a bug. Please read the Resource Programming Guide. Unlike iOS,
>> -awakeFromNib is sent to File's Owner as well as every object deserialized
>> from the nib. OS X has behaved like this for 20 years.
>
> One of us is missing the point. Yes, awakeFromNib gets called for these
> objects. The question is why does the viewController’s awakeFromNib get
> called every time a cell view is instantiated or copied? That cell view’s
> awakeFromNib should get called, not the main viewController’s awakeFromNib.
The view controller is presumably the NIB's File's Owner. Therefore, per what Kyle said, it has -awakeFromNib called on it every time the NIB is loaded. The NIB is being loaded to instantiate each cell view, so -awakeFromNib is called each time.
-Ken
_______________________________________________
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