objc_setAssociatedObject上的EXC_BAD_ACCESS with -weak_library /usr/ libsystem . b。dylib链接器标志

时间:2022-04-26 21:46:31

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

当我调用objc_setAssociatedObject与链接器标志:-weak_library /usr/lib/libSystem.B时,我有一个EXC_BAD_ACCESS。dylib链接标志。

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)

(我也有一个关于dispatch_async的崩溃,但是我可以解决这个问题……)另外,我在我的应用程序上建立了一个ios4的特性它是ios3兼容的)

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

编辑:随着更多的研究,我发现了这个和这个问题,但没有更多的答案……

1 个解决方案

#1


23  

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

问题只是iOS模拟器中的一个bug。这些代码在设备上运行良好。

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

我对苹果的bug报告充满了怀疑(radar://9470793)

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

编辑:刚刚发现:-weak_library /usr/lib/libSystem.B。dylib打破了iOS模拟器。使用-weak-lSystem代替。

#1


23  

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

问题只是iOS模拟器中的一个bug。这些代码在设备上运行良好。

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

我对苹果的bug报告充满了怀疑(radar://9470793)

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

编辑:刚刚发现:-weak_library /usr/lib/libSystem.B。dylib打破了iOS模拟器。使用-weak-lSystem代替。