Re: Objective-C: What is the current preferred method of declaring constants without a .pch?
Steve Christensen <punster@...>
I use constants a lot, but I put their declarations and definitions into the "owner" class files. For example if one object sources notifications and others consume them.
toggle quoted message
Show quoted text
Foo.h extern NSString* const __nonnull FooNotification; Foo.m NSString* const FooNotification = @"FooNotification"; With Obj-C I have rarely ended up with true globals since I can create singletons as "global" instances of particular classes. I have created .h files containing some #defines that are used to conditionally compile certain features that may not be quite ready for primetime and so it could get pulled before an app ships. Steve On Oct 19, 2017, at 12:11 PM, Alex Zavatone <zav@...> wrote: |
|