I have an app that works with and without the linker flag. However, without the linker flag, I get a very different behaviour when adding data to a view.
Asked
Active
Viewed 3.8k times
145

ROMANIA_engineer
- 54,432
- 29
- 203
- 199

bsarrazin
- 3,990
- 2
- 18
- 31
-
1bensarz, you get a _different_ behaviour without the linker flag... What does that mean?? Different how? – Adil Hussain Jun 20 '17 at 13:12
1 Answers
164
This flag causes the linker to load every object file in the library that defines an Objective-C class or category. While this option will typically result in a larger executable (due to additional object code loaded into the application), it will allow the successful creation of effective Objective-C static libraries that contain categories on existing classes.
From this Technical Q&A

sergio
- 68,819
- 11
- 102
- 123
-
2Great! Thank you. Is this caused by the fact that we are using GCC 4.2 as a compiler? Would using LLVM GCC 4.2 or LLVM Compiler 2.0 solve the problem? Or am I mixing up stuff that shouldn't be mixed? – bsarrazin Jul 08 '11 at 20:25
-
I think that the behavior is the same with both compilers (besides, I don't know if there are 2 different linkers)... – sergio Jul 08 '11 at 20:35
-
4Does this mean that you would never need `-ObjC` in anything other than a library / SDK? I.e. you should never need to use it in an actual app target? – Robert Feb 24 '14 at 15:20
-
3No, this means you need -ObjC in any project implementing a library that has a category or embedded framework in it – arc4randall Jan 08 '16 at 00:20
-