FROM : Andre
DATE : Wed Nov 07 06:32:42 2007
On $BJ?@.(B 19/11/07, at 11:32, Ali Ozer wrote:
>> You can declare a property in a category, like so:
>>
>> @interface NSView (Properties)
>> @property (assign) NSRect bounds;
>> @end
>>
>> @interface NSView (Properties)
>> @dynamic bounds;
>> @end
>>
>> As long as there is a <key> and set<key> method pair, you can
>> "tack" on a property.
>> I've done it for some pre-leopard objects such as a subviews
>> property etc on NSView...
>
> You don't need to tack on an explicit property declaration. The dot-
> syntax will work for any getter/setter pair, as long as the
> receiving object is statically typed. In the original example,
> sender is declared as "id," so it doesn't work.
Thats nice to know. Thanks.
Andre
>
> Ali
>
>
DATE : Wed Nov 07 06:32:42 2007
On $BJ?@.(B 19/11/07, at 11:32, Ali Ozer wrote:
>> You can declare a property in a category, like so:
>>
>> @interface NSView (Properties)
>> @property (assign) NSRect bounds;
>> @end
>>
>> @interface NSView (Properties)
>> @dynamic bounds;
>> @end
>>
>> As long as there is a <key> and set<key> method pair, you can
>> "tack" on a property.
>> I've done it for some pre-leopard objects such as a subviews
>> property etc on NSView...
>
> You don't need to tack on an explicit property declaration. The dot-
> syntax will work for any getter/setter pair, as long as the
> receiving object is statically typed. In the original example,
> sender is declared as "id," so it doesn't work.
Thats nice to know. Thanks.
Andre
>
> Ali
>
>
| Related mails | Author | Date |
|---|---|---|
| Joshua Emmons | Nov 7, 02:30 | |
| mmalc crawford | Nov 7, 02:40 | |
| listposter | Nov 7, 03:14 | |
| Ali Ozer | Nov 7, 03:32 | |
| Andre | Nov 7, 06:32 |






Cocoa mail archive

