On 9/17/09 1:26 PM, Konrad Windszus said:

>I have a classical binding usecase: A NSArrayController is used for
>displaying the columns of a NSTableView. The columns itself therefore
>use the arrangedObject method of the NSArrayController. In the get
>methods of the model itself (which normally return an NSString* which
>should be displayed in the column), there could occur an exception. I
>want to catch that exception in the NSArrayController. I therefore
>subclassed the NSArrayController and overwrote valueForKeyPath with a
>simple:
>
>- (id)valueForKeyPath:(NSString *)keyPath {
>       try {
>               [super valueForKeyPath:keyPath];
>       }
>       catch (...) {
>               // want to get here, if there is an exception thrown within the
>model class
>       }
>}
>
>Unfortunately it is only called with arrangedObjects. At that point no
>exception is thrown yet. Somewhere after that a valueForKeyPath must
>be executed on that returned arrangedObjects. Since I have not
>subclassed this proxy class, I cannot intercept its valueForKeyPath
>method and therefore cannot catch the exception. Is there a simple way
>to catch exceptions in the controller class which is thrown during
>calling a get method (over binding mechanims)?

What's this exception you speak of?  Are you throwing or is the system?

--
____________________________________________________________
Sean McBride, B. Eng                 [email protected]
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to