views:

219

answers:

1

I need to create static constants in a class that can be used by other classes that import that class. I'm assuming that enum would be the best way to go since I have seen it been used quite often through out Cocoa classes.

+2  A: 

It depends on how the type is going to be used. An enum can be a simple way to create some named values, but NSString constants can mesh better with the rest of Cocoa (for instance, this is how all the attribute keys for NSAttributedString are represented because they're meant to be stored in a dictionary).

Chuck