KVO Question: How to programmatically determine if one object is observing another on a keyPath and context?

2012-09-09 Thread Motti Shneor
Hi everyone. This seems a novice question, but I could not find any high-level approach for that. Some details of my special need: I have an NSViewController subclass, that should observe some attribute of its representedObject. However, the representedObject may change to another, become nil

Re: Strange crash while loading nib

2012-09-09 Thread Markus Spoettl
On 9/9/12 8:41 AM, Graham Cox wrote: On 09/09/2012, at 4:25 PM, Markus Spoettl mailto:ms_li...@shiftoption.com>> wrote: 4 -[NSArrayController didChangeValuesForArrangedKeys:objectKeys:indexKeys:] 5 -[NSArrayController initWithCoder:] This suggests that initWithCoder: is setting a propert

Re: KVO Question: How to programmatically determine if one object is observing another on a keyPath and context?

2012-09-09 Thread Richard Somers
On Sep 9, 2012, at 3:32 AM, Motti Shneor wrote: > - (NSUInteger)isObserver:(id)object on keyPath:(NSString *)keyPath > withContext:(void *)context]; // the returned number is the count of same > observances with 0 as not-observing). > > and something like > > - (BOOL)removeObserver:(id)object

Re: Code Comments

2012-09-09 Thread Mike Abdullah
Further to existing comments: * NSXMLParser supports NSInputStream directly these days; consider moving to that * When releasing the parser because you're finished with it, might as well set the delegate to nil so you can't accidentally end up with a dangling pointer there On 9 Sep 2012, at 04

Re: KVO Question: How to programmatically determine if one object is observing another on a keyPath and context?

2012-09-09 Thread Mike Abdullah
On 9 Sep 2012, at 10:32, Motti Shneor wrote: > Hi everyone. This seems a novice question, but I could not find any > high-level approach for that. > > Some details of my special need: I have an NSViewController subclass, that > should observe some attribute of its representedObject. > > How

Re: autosavesInPlace and sandbox

2012-09-09 Thread Mike Abdullah
On 7 Sep 2012, at 21:35, Charles Srstka wrote: > On Sep 7, 2012, at 1:15 PM, Kyle Sluder wrote: > >> I guess the question is, "why are you saving a 4GB file?" Media editors >> don't do that; they split the file into chunks and bundle them in a >> project folder. For other apps, we have documen

Re: Code Comments

2012-09-09 Thread koko
On Sep 9, 2012, at 7:35 AM, Mike Abdullah wrote: > NSXMLParser supports NSInputStream directly these days; consider moving to > that That is excellent but for now I must run on 10.5.8 … ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: KVO Question: How to programmatically determine if one object is observing another on a keyPath and context?

2012-09-09 Thread Ken Thomases
On Sep 9, 2012, at 4:32 AM, Motti Shneor wrote: > Hi everyone. This seems a novice question, but I could not find any > high-level approach for that. > > Some details of my special need: I have an NSViewController subclass, that > should observe some attribute of its representedObject. > > Ho

Re: KVO Question: How to programmatically determine if one object is observing another on a keyPath and context?

2012-09-09 Thread Motti Shneor
On 9 בספט 2012, at 22:04, Ken Thomases wrote: > On Sep 9, 2012, at 4:32 AM, Motti Shneor wrote: > >> Hi everyone. This seems a novice question, but I could not find any >> high-level approach for that. >> >> Some details of my special need: I have an NSViewController subclass, that >> should

Re: KVO Question: How to programmatically determine if one object is observing another on a keyPath and context?

2012-09-09 Thread Fritz Anderson
On 9 Sep 2012, at 3:50 PM, Motti Shneor wrote: > Nope. When representedObject becomes nil, I DO NOT WANT to observe anything, > and I need to remove the observance from the previous representedObject, > BEFORE it is set to nil on my NSViewController. > > If I added myself as an observer to a s

Re: KVO Question: How to programmatically determine if one object is observing another on a keyPath and context?

2012-09-09 Thread Quincey Morris
On Sep 9, 2012, at 13:50 , Motti Shneor wrote: > On 9 בספט 2012, at 22:04, Ken Thomases wrote: > >> Why is that a "however"? What's the problem? Since the representedObject >> is KVO-compliant, all observations _through_ that property will >> automatically follow it as it changes. > > Nope.

Re: KVO Question: How to programmatically determine if one object is observing another on a keyPath and context?

2012-09-09 Thread Lee Ann Rucker
Yes, that approach is *so* much safer. When we switched over to doing it that way so many "dealloc called while object was being observed" problems went away. - Original Message - From: "Quincey Morris" To: "Motti Shneor" Cc: "Cocoa-Dev List" Sent: Sunday, September 9, 2012 4:26:27 PM

nstableview without nsscrollview

2012-09-09 Thread Alfian Busyro
I'm thinking to have an un-scrollable nstableview in mac-osx app. because I don't want user to scroll within the table, but have to Is it possible to have a table view without scroll view, or maybe to extract table view from scroll view ? Regards, Alfian. _