It looks like you want to create constants (since you are using final
in your question). In Objective-C, you can use extern
for that.
Do something like this:
1) Create a new Objective-C class named Constants.
2) In the header (.h) file:
extern const NSString *SERVICE_URL;
3) In the implementation (.m) file:
NSString *SERVICE_URL = @"http://something/services";
4) Add #import "Constants.h"
to any class where you want to use it
5) Access directly as NSString *url = SERVICE_URL;
If you don't want to create constants and simply want to use static
in Objective-C, unfortunately you can only use static
in the implementation (.m) file. And they can be accessed directly without prefixing the Class Name.
For example:
static NSString *url = @"something";
I hope this helps.