今天在用iOS写个计算器的时候,遇到的一个小bug,新手,太新了,不之所错。

直接上码:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason:

'[<SecondViewController 0x7f83435347d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key txtscreen.'

造成错误的原因:

1、建了一个outlet:txtscreen;

2、然后想删除它,就把它的代码删了;

3、运行程序后,出现上述错误;

因为只在代码处删除该outlet,这是不完全的删除(既没有彻底的删除txtscreen),在该ViewController中还是有txtscreen,如图,一个小感叹号。

所以,如果出现类似的代码,那就是因为删除不彻底导致的。

解决办法:选中对应的ViewController的edit,右击,在Outlets中把该txtscreen删除就可以了。如图:

outlet删除不完全的更多相关文章

  1. IOS 错误原因

    当xcode提示以下错误时,很可能的原因是由于ViewController中的View在Controller中连接了outlet,然后又删除了Controller中对应的属性,导致xcode找不到这个 ...

  2. iOS Xcode, 解决“Could not insert new outlet connection: Could not find any information for the class named”的问题。

    在Xcode中,我们可以在StoryBoard编辑界面或者是xib编辑界面中通过“Control键+拖拽“的方式将某个界面元素和对应的代码文件连接起来,在代码文件中创建outlet. 不过,如果你的运 ...

  3. iOS Xcode, 解决“Could not insert new outlet connection”的问题。

    在Xcode中,我们能够在StoryBoard编辑界面或者是xib编辑界面中通过"Control键+拖拽"的方式将某个界面元素和相应的代码文件连接起来,在代码文件里创建outlet ...

  4. ios开发之--解决“Could not insert new outlet connection”的问题。

    在Xcode中,我们能够在StoryBoard编辑界面或者是xib编辑界面中通过“Control键+拖拽“的方式将某个界面元素和相应的代码文件连接起来.在代码文件里创建outlet. 只是.假设你的运 ...

  5. [报错] Xcode Error-Could not insert new outlet connection: Could not find any information for the class named "xxx"

    当从StoryBoard或xib中需要将控件绑定类文件时(OC中是.m文件,Swift中是.swift文件) 当按住control键将控件往类文件中拖拽后,填写控件的name后,点击connect时 ...

  6. "无法删除数据库,因为该数据库当前正在使用"问题解决

    异常处理汇总-数据库系列  http://www.cnblogs.com/dunitian/p/4522990.html 以前刚学数据库的时候比较苦恼这个问题,今天删除的时候又看见了,正好一起记录一下 ...

  7. php批量删除

    php批量删除可以实现多条或者全部数据一起删除 新建php文件 显示数据库中内容: <table width="100%" border="1" cell ...

  8. linux centos中添加删除修改环境变量,设置java环境变量

    前言 安装完软件必要添加环境变量.指令很少,然而长时间不写就会不自信:我写的对吗?于是百度开始,于是发现又是各有千秋.好吧,好记星不如烂笔头.当然,最重要的是,百度出来的都他妈的是如何添加环境变量,只 ...

  9. ASP.NET MVC一次删除多笔记录

    批量删除数据记录,如下面的截屏: 先选中想删除的记录,然后点一下删除铵钮,系统将把选中的记录一次性删除.在此,Insus.NET不想每删除一笔记录连接一次数据库. 因此需要把选择的记录一次上传至服务器 ...

随机推荐

  1. Windows Server 2008找回密码

    1.通过Windows Server 2008 R2的安装光盘引导计算机启动,映像加载完毕后 ,按 Shift+F10 ,打开命令提示符界面,进入Windows目录所在分区(cd windows\sy ...

  2. 【转】CppUnit使用简介

    以下内容来自:http://www.cnblogs.com/wishma/archive/2008/08/01/1258370.html 1. 简介 CppUnit 是个基于 LGPL 的开源项目,最 ...

  3. [AngularJS] 'require' prop in Directive or Component

    When use 'require', recommend to add some error check, for example: class ChildCtrl { constructor(){ ...

  4. [React Native] Using the WebView component

    We can access web pages in our React Native application using the WebView component. We will connect ...

  5. C++类的定义之作用域

    每个类都定义了自己的新作用域和唯一的类型.在类的定义体内声明内成员,将成员名引入类的作用域.两个不同的类具有两个不同的类作用域. 例如: Class First { int memi; double  ...

  6. PAT 1013

    1013. Battle Over Cities (25) It is vitally important to have all the cities connected by highways i ...

  7. How to center a div in bootstrap3

    There are two approaches to centering a column <div> in Bootstrap 3: Approach 1 (offsets): The ...

  8. mysql数据库常用语句

    关于mysql数据库常用命令的整理: 一:对于数据库的操作 show databases;显示当前用户下所有的数据库名称 use database_name;进入当前数据库 create databa ...

  9. huhamhire-hosts必备神器!

    huhamhire-hosts 不用说你就知道是干嘛用的. 上地址: https://github.com/huhamhire/huhamhire-hosts https://hosts.huhamh ...

  10. vagrant Ubuntu server 12.04 dpkg: dependency problems prevent configuration of python-gi

    Ubuntu server 12.04因为尝试安装过xfce,导致sudo apt-get install xxx 都会返回,如: vagrant@precise32:~$ sudo apt-get ...