cschuff
cschuff

Reputation: 5542

How to define a macro globally in Objective-C?

I want to define a macro globally. I want to override NSLocalizedString() throughout my whole project. Is that possible and how do I do it?

Upvotes: 4

Views: 3429

Answers (2)

debleek63
debleek63

Reputation: 1171

You define your macro in some header file. You place this header file in *.pch file (prefix header file). Search for "prefix" in build settings for your target. Make sure your *.pch file is used.

Upvotes: 5

max_
max_

Reputation: 24521

Declare the macro in the #ifdef __OBJC__ section of your AppName-Prefix.pch.

Upvotes: 18

Related Questions