Leopard Properties and 'non-nil' declaration

Scott Anguish scott at cocoadoc.com
Sat Jan 5 23:33:42 PST 2008


that use of the term "property" I believe predates Objective-C 2.0  
Properties


I don't believe it is intended to imply Objective-C 2.0 Properties  
specifically.


On Jan 6, 2008, at 1:28 AM, André Pang wrote:

> On 06/01/2008, at 5:18 PM, Scott Stevenson wrote:
>
>>> Right now I'm resorting to writing my own setters for properties  
>>> that I want to be non-nil, which is OK, but hey, the less work I  
>>> have to do, the better :)
>>
>> Key-Value Validation may help:
>> <http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/Validation.html 
>> >
>
> I looked at that.  However, that documentation says that Key-Value  
> Validation methods are not called when a property is set:
>
>  "Key-value coding does not perform validation automatically. It is,  
> in general, your application’s responsibility to invoke the  
> validation methods"
>
> and:
>
>  "Warning: An implementation of -set<Key>: for a property should  
> never call the validation methods."
>
> It feels like Key-Value Validation is designed for higher-level  
> purposes than making sure an object is non-nil in a setter.  From  
> what I've read, it seems like the setter methods are the correct  
> place to check for that.
>
>
> -- 
> % Andre Pang : trust.in.love.to.save  <http://www.algorithm.com.au/>
>
>
>
> _______________________________________________
> MacOSX-dev mailing list
> MacOSX-dev at omnigroup.com
> http://www.omnigroup.com/mailman/listinfo/macosx-dev



More information about the MacOSX-dev mailing list