在我的应用中使用块只会在iOS4.3上导致EXC_BAD_ACCESS

|| 我已将LambdaAlert中的示例代码粘贴到我的应用中,当我在iOS4.3上运行时,它会生成EXC_BAD_ACCESS错误。相同的代码在较早版本的OS中可以正常工作。
  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,我需要做些不同的事情吗?
已邀请:
-weak_library /usr/lib/libSystem.B.dylib
破坏iOS模拟器。请改用
-weak-lSystem

要回复问题请先登录注册