discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Soliciting Thoughts on the new NSController


From: Chris Hanson
Subject: Re: Soliciting Thoughts on the new NSController
Date: Wed, 29 Oct 2003 17:56:19 -0600

On Oct 29, 2003, at 2:25 AM, Philippe C.D. Robert wrote:
Is there some documentation available on the net already? I could not find it on the Cocoa pages.

Follow the links in my weblog post to the actual NSController class documentation.

You also need to look at the documentation for the NSKeyValueCoding protocol in FoundationKit, as well as the documentation for the following methods in NSObject:

  +automaticallyNotifiesObserversForKey:
  +setKeys:triggerChangeNotificationsForDependentKey:
  -observeValueForKeyPath:ofObject:change:context:
  -addObserver:forKeyPath:options:context:
  -removeObserver:forKeyPath:
  -setObservationInfo
  -observationInfo
  -willChangeValueForKey:
  -willChange:valuesAtIndexes:forKey:
  -didChangeValueForKey:
  -didChange:valuesAtIndexes:forKey:

and the following methods in NSArray:

  -addObserver:toObjectsAtIndexes:forKeyPath:options:
  -removeObserver:fromObjectsAtIndexes:forKeyPath:

Also check out the following protocols in ApplicationKit:

  NSKeyValueBindingCreation
  NSEditor
  NSEditorRegistration

Good to see that Apple uses ObjC rather than anything else for new features and additions! :-)

Yeah, almost all new software coming out of Apple is written in Objective-C.

There are also additions to the Objective-C language itself in gcc 3.3. In particular, it now has Java-style exceptions:

  @try {
    // something that might throw

    @throw anException;
  }

  @catch (NSException *exception) {
    // handle the exception
  }

  @catch (id unhandledException) {
    @throw; // re-raise the exception
  }

  @finally {
    // do any necessary clean-up
  }

And it has Java-style synchronization:

  @synchronized (someArray) {
    id object = [someArray lastObject];
    [someArray removeLastObject];
  }

Throwing an Objective-C exception in a @synchronized block clears any locks.

  -- Chris

--
Chris Hanson, bDistributed.com, Inc.  |  Email: address@hidden
Custom Mac OS X Development           |  Phone: +1-847-372-3955
http://bdistributed.com/              |  Fax:   +1-847-589-3738
http://bdistributed.com/Articles/     |  Personal Email: address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]