Objective-C A lock property defined as not working copy

I see strange behavior with Objective-C blocks in a large project. Wherever there is a Block property that is defined as copying , a crash occurs when the application attempts to refer to the property later. Overriding the setter implementation from the @synthesize d implementation and calling Block_copy () explicitly does the trick, but it is interesting that when the same code is used in a different project context, the properties work as expected.

It must be some kind of project or a dependency problem. Has anyone come across similar things before?

+4
source share
1 answer

Thanks, Bavaria. The main problem is the libSystem library associated with the application.

The fix is ​​to remove "- weak_library / usr / lib / libSystem.B.dylib" from the target linker flag and replace it with "- weak LSYSTEM" .

+2
source

All Articles