Skip navigation.
 
mlRe: Proper use of #define to aid in compile-time checking of strings (was KVC and KVO for arrays)
FROM : Nick Toumpelis
DATE : Fri Feb 15 22:23:52 2008

On 15 Φεβ 2008, at 5:52 ΜΜ, John Dann wrote:

> If I want to change the name of the NSOutlineView column to which 
> the #define statement referrs at some time in the future, I'll have 
> to change both, and likely forget one.  Is there any way around this 
> without placing the #define in my NSDocument subclass's .h file?


You could define a constant method (like in SmallTalk) in your main 
class, that your categories can call e.g.:

- (NSString *) sourceListColumnID {
   return @"sourceListColumn";
}

This can be called from your categories and you won't have to 
duplicate your constants.

Nick

Related mailsAuthorDate
mlKVC and KVO for arrays Hans van der Meer Feb 12, 21:32
mlRe: KVC and KVO for arrays Hans van der Meer Feb 12, 23:07
mlRe: KVC and KVO for arrays Adam P Jenkins Feb 12, 23:09
mlRe: KVC and KVO for arrays mmalc crawford Feb 13, 14:00
mlRe: KVC and KVO for arrays Adam P Jenkins Feb 13, 15:37
mlRe: KVC and KVO for arrays mmalc crawford Feb 13, 16:34
mlRe: KVC and KVO for arrays Adam P Jenkins Feb 13, 17:51
mlRe: KVC and KVO for arrays Jens Alfke Feb 13, 18:08
mlRe: KVC and KVO for arrays Adam P Jenkins Feb 13, 20:24
mlRe: KVC and KVO for arrays mmalc crawford Feb 13, 22:21
mlRe: KVC and KVO for arrays mmalc crawford Feb 13, 22:30
mlRe: KVC and KVO for arrays Kyle Sluder Feb 13, 22:30
mlRe: KVC and KVO for arrays Adam P Jenkins Feb 13, 22:57
mlRe: KVC and KVO for arrays Ken Thomases Feb 13, 23:05
mlRe: KVC and KVO for arrays Jens Alfke Feb 14, 00:33
mlRe: KVC and KVO for arrays Adam P Jenkins Feb 14, 07:47
mlRe: KVC and KVO for arrays John Dann Feb 14, 15:05
mlRe: KVC and KVO for arrays Nick Toumpelis Feb 15, 10:54
mlRe: KVC and KVO for arrays John Dann Feb 15, 11:27
mlRe: KVC and KVO for arrays Nick Toumpelis Feb 15, 13:20
mlRe: KVC and KVO for arrays Hans van der Meer Feb 15, 14:44
mlRe: KVC and KVO for arrays John Dann Feb 15, 15:10
mlRe: KVC and KVO for arrays Stephen Hoffman Feb 15, 16:18
mlProper use of #define to aid in compile-time checking of strings (was KVC and KVO for arrays) John Dann Feb 15, 16:52
mlRe: KVC and KVO for arrays Kyle Sluder Feb 15, 18:43
mlRe: Proper use of #define to aid in compile-time checking of strings (was KVC and KVO for arrays) Nick Toumpelis Feb 15, 22:23
mlRe: Proper use of #define to aid in compile-time checking of strings (was KVC and KVO for arrays) Jonathan Dann Feb 16, 17:21