Re: Multiple Observations

2013-06-16 Thread Gordon Apple
You have a valid point. However, awakeFromNib is a traditional place to setup observers, etc. Plus, the docs even recommend this: ³Important: It is possible that your datasource methods for populating the outline view may be called before awakeFromNib is called if the datasource is specified in

Re: Multiple Observations

2013-06-15 Thread Seth Willits
On Jun 15, 2013, at 1:32 PM, Gordon Apple wrote: > I still think the compiler should be smart enough to block this > without having to put a on-shot blocking flag in awakeFromNib, which I have > now done. My question would be, why are you using awakeFromNib specifically in the first place? I rea

Re: Multiple Observations

2013-06-15 Thread Gordon Apple
. On 6/15/13 1:27 PM, "Kyle Sluder" wrote: > On Jun 15, 2013, at 11:20 AM, Gordon Apple wrote: > >> Re: Multiple Observations Well, I have to say that this statement is highly >> ambiguous. > > It is not ambiguous. It is clear as night and day. -awakeFromNi

Re: Multiple Observations

2013-06-15 Thread Kyle Sluder
On Jun 15, 2013, at 11:20 AM, Gordon Apple wrote: > Well, I have to say that this statement is highly ambiguous. It is not ambiguous. It is clear as night and day. -awakeFromNib is sent to File's Owner during nib loading. End of story. > It does not explicitly say that awakeFromNib is sent to

Re: Multiple Observations

2013-06-15 Thread Gordon Apple
Well, I have to say that this statement is highly ambiguous. It does not explicitly say that awakeFromNib is sent to the file’s owner separately for every interface object. My reading of this would interpret it to say it is sent once to the file’s owner, in addition to being sent to to each inter

Re: Multiple Observations

2013-06-15 Thread Kyle Sluder
On Sat, Jun 15, 2013, at 09:51 AM, Gordon Apple wrote: > I don¹t seen anything about this in the referenced docs. From "The Object Loading Process", from the Nib Files chapter of the Resource Programming Guide

Re: Multiple Observations

2013-06-15 Thread Seth Willits
Adding onto what's been said already, even without the view-based tableview case, the fact that awakeFromNib can be called multiple times is why I generally never use it. Yeeears ago I was bitten by a view controller subclass have its awakeFromNib being called twice because it was instantiated i

Re: Multiple Observations

2013-06-15 Thread Gordon Apple
ot; wrote: > On Jun 15, 2013, at 8:54 AM, Gordon Apple wrote: > >> Re: Multiple Observations Kyle, >> >> One of us is missing the point. Yes, awakeFromNib gets called for these >> objects. The question is why does the viewController¹s awakeFromNib get >> ca

Re: Multiple Observations

2013-06-15 Thread Kyle Sluder
On Jun 15, 2013, at 9:15 AM, Ken Thomases wrote: > > 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 call

Re: Multiple Observations

2013-06-15 Thread Ken Thomases
On Jun 15, 2013, at 10:54 AM, Gordon Apple wrote: > On 6/15/13 10:19 AM, "Kyle Sluder" wrote: > >> On Jun 15, 2013, at 8:08 AM, Gordon Apple wrote: >> OMG! I thought for sure I had checked awakeFromNib. That is the problem. My view-based outline view has issues. makeViewWithIdenti

Re: Multiple Observations

2013-06-15 Thread Kyle Sluder
On Jun 15, 2013, at 8:54 AM, Gordon Apple wrote: > Kyle, > > 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 > awake

Re: Multiple Observations

2013-06-15 Thread Gordon Apple
BTW, I’ve just reproduced the problem in TableViewPlayground. On 6/15/13 10:19 AM, "Kyle Sluder" wrote: > On Jun 15, 2013, at 8:08 AM, Gordon Apple wrote: > >> > I shouldn¹t need to look at the context. > > You must ALWAYS check the context. > >> > >> > OMG! I thought for sure I had check

Re: Multiple Observations

2013-06-15 Thread Gordon Apple
Kyle, 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 awakeFrom

Re: Multiple Observations

2013-06-15 Thread Kyle Sluder
On Jun 15, 2013, at 8:08 AM, Gordon Apple wrote: > I shouldn¹t need to look at the context. You must ALWAYS check the context. > > OMG! I thought for sure I had checked awakeFromNib. That is the problem. > My view-based outline view has issues. makeViewWithIdentifier:owner: is > causing th

Re: Multiple Observations

2013-06-15 Thread Gordon Apple
I shouldn¹t need to look at the context. However, I did try it using a specified context (and check for it) and got the same result. The setter is only getting called once. OMG! I thought for sure I had checked awakeFromNib. That is the problem. My view-based outline view has issues. makeView

Re: Multiple Observations

2013-06-14 Thread Lee Ann Rucker
On Jun 14, 2013, at 1:06 PM, Gordon Apple wrote: > - (void)awakeFromNib { >[self.doc addObserver:self > forKeyPath:@"currentPath" > options:NSKeyValueObservingOptionNew | > NSKeyValueObservingOptionOld > context:nil]; > } > > - (void)observeVal

Re: Multiple Observations

2013-06-14 Thread Quincey Morris
On Jun 14, 2013, at 13:06 , Gordon Apple wrote: > ³currentPath² property in doc gets set once. Observation gets dinged about > 200 times. Removing the ³reloadData² didn¹t affect this. Same observer in > another file gets dinged once, like it should. Stack trace always leads > back to where "c

Multiple Observations

2013-06-14 Thread Gordon Apple
- (void)awakeFromNib { [self.doc addObserver:self forKeyPath:@"currentPath" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil]; } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(