7

I have a EXC_BAD_ACCESS when I call objc_setAssociatedObject with the linker flags : -weak_library /usr/lib/libSystem.B.dylib linker flags.

I absolutely need the linker flag because of this, do somebody know a workaround?

(I also have a crash on dispatch_async but I can work around that... Also, I'm building a iOS 4 only feature on my app that is iOS 3 compatible)

EDIT: With more research, I found this and this question but no more answer...

Community
  • 1
  • 1
gcamp
  • 14,622
  • 4
  • 54
  • 85

1 Answers1

23

The problem is simply a bug in the iOS Simulator. The codes works fine on the device.

I've filled a radar on Apple's bug reporter (radar://9470793)

EDIT: Just found out : -weak_library /usr/lib/libSystem.B.dylib breaks the iOS Simulator. Use -weak-lSystem instead.

gcamp
  • 14,622
  • 4
  • 54
  • 85
  • Can anyone explain why that is? /usr/lib/libSystem.dylib symlinks to /usr/lib/libSystem.B.dylib. Or is the crash because it should be using the Simulator SDK's libSystem instead? – lhunath Nov 14 '11 at 10:07