【问题标题】:IBAction unknown error [closed]IBAction未知错误[关闭]
【发布时间】:2014-03-19 09:34:05
【问题描述】:
    - (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 如果我在没有应用程序构建崩溃的操作的情况下使用它。我放了一个异常断点,它给出了这个错误

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) 

【问题讨论】:

  • 你忘了大括号 } 吗?正确的必须是:- (IBAction)ButtonPress:(UIButton *)sender { }
  • 哦,我想我一定是在虚无的尽头。测试一下
  • 你为什么把-(void)方法放在IBAction里面?
  • 为什么我现在有 -1 我做错了什么?抱歉,这是我在这里的第一个问题。

标签: ios objective-c xcode uibutton ibaction


【解决方案1】:

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

    - (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];
            }
         }
}

【讨论】:

  • 我改了,但是改完后出现这个错误2014-03-19 10:41:54.497 AbteiRD[9272:70b] Cannot find executable for CFBundle 0x8a81ca0 &lt;/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/AccessibilityBundles/CertUIFramework.axbundle&gt; (not loaded) 2014-03-19 10:42:01.280 AbteiRD[9272:70b] -[mainViewController ButtonPressed:]: unrecognized selector sent to instance 0x8ab5be0 (lldb)
  • 更改代码后。转到xib的文件并为您的按钮重新制作您的操作
  • 我已经做到了,但现在出现了一个真正的巨大错误,这是它的最后一部分&lt;Error&gt;: CGContextSetBlendMode: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update. (lldb)
  • 您的代码似乎犯了很多错误。所以,请发布你的源代码,然后给我链接,也许我可以帮助你。
  • link这里是源代码
猜你喜欢
  • 2022-01-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-06-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多