IBAction未知错误

时间:2014-03-19 09:34:05

标签: ios objective-c xcode uibutton ibaction

    - (IBAction)ButtonPress:(UIButton *)sender {


- (void) ButtonPressed: (id) sender
    {
        if (sender != self.done)
            return;
        if (self.zahlencode.text.length > 0)
        {
            zz =[self.zahlencode.text intValue];
            if(zz == a)
            {

                [self performSegueWithIdentifier:@"1" sender:self];
            }
        }
    }

}

在Void ButtonPressed上有一个错误,显示Use of undeclared ButtonPressed 如果我在没有动作的情况下使用它,则App构建崩溃。我在那里放了一个Exception Breakpoint,它发出了这个错误

2014-03-19 10:19:53.295 AbteiRD[8873:70b] Cannot find executable for CFBundle 0x8a91780 </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/AccessibilityBundles/CertUIFramework.axbundle> (not loaded)
(lldb) 

1 个答案:

答案 0 :(得分:0)

你不能将 void 函数放入 - (IBAction)ButtonPress:(UIButton *)发件人更改如下:

    - (IBAction)ButtonPress:(UIButton *)sender {
       if (sender != self.done)
            return;
        if (self.zahlencode.text.length > 0)
        {
            zz =[self.zahlencode.text intValue];
            if(zz == a)
            {

                [self performSegueWithIdentifier:@"1" sender:self];
            }
         }
}