我已将LambdaAlert中的示例代码粘贴到我的应用中,当我在iOS4.3上运行时,它会生成EXC_BAD_ACCESS错误。相同的代码在较旧版本的操作系统中运行良好。
LambdaAlert *alert = [[LambdaAlert alloc]
initWithTitle:@"Test Alert"
message:@"See if the thing works."];
[alert addButtonWithTitle:@"Foo" block:^{ NSLog(@"Foo"); }]; // <-- Crashes here with EXC_BAD_ACCESS no matter what code is in the block (even an empty block!)
[alert addButtonWithTitle:@"Bar" block:^{ NSLog(@"Bar"); }];
[alert addButtonWithTitle:@"Cancel" block:NULL];
[alert show];
[alert release];
对于iOS4.3,我需要做些什么?
答案 0 :(得分:1)
-weak_library /usr/lib/libSystem.B.dylib
打破了iOS模拟器。请改用-weak-lSystem
。