当我运行我的 Swift 游戏并按下按钮转到另一个屏幕时,我收到此错误:
2015-08-30 04:14:48.038 SHE. 1.0[45317:3481211] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x7fe958e50500 H:[UIButton:0x7fe958e4de70'Button']-(8)-[UIButton:0x7fe958e4c2d0'Play']>",
"<NSLayoutConstraint:0x7fe958e50550 H:[UIButton:0x7fe958e4de70'Button']-(73)-[UIButton:0x7fe958e4c2d0'Play']>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7fe958e50550 H:[UIButton:0x7fe958e4de70'Button']-(73)-[UIButton:0x7fe958e4c2d0'Play']>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2015-08-30 04:14:48.040 SHE. 1.0[45317:3481211] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x7fe958e505a0 H:[UIButton:0x7fe958e4c2d0'Play']-(8)-[UIButton:0x7fe958e4eac0'Button']>",
"<NSLayoutConstraint:0x7fe958e505f0 H:[UIButton:0x7fe958e4c2d0'Play']-(73)-[UIButton:0x7fe958e4eac0'Button']>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7fe958e505f0 H:[UIButton:0x7fe958e4c2d0'Play']-(73)-[UIButton:0x7fe958e4eac0'Button']>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2015-08-30 04:14:49.304 SHE. 1.0[45317:3481211] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Storyboard (<UIStoryboard: 0x7fe958e45b80>) doesn't contain a view controller with identifier 'GameViewController''
*** First throw call stack:
(
0 CoreFoundation 0x000000010e475c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000110194bb7 objc_exception_throw + 45
2 UIKit 0x000000010f402a66 -[UIStoryboard instantiateInitialViewController] + 0
3 SHE. 1.0 0x000000010ded1422 _TFC8SHE__1_08MainMenu18playButotonPressedfS0_FCSo8UIButtonT_ + 226
4 SHE. 1.0 0x000000010ded153a _TToFC8SHE__1_08MainMenu18playButotonPressedfS0_FCSo8UIButtonT_ + 58
5 UIKit 0x000000010eec9d62 -[UIApplication sendAction:to:from:forEvent:] + 75
6 UIKit 0x000000010efdb50a -[UIControl _sendActionsForEvents:withEvent:] + 467
7 UIKit 0x000000010efda8d9 -[UIControl touchesEnded:withEvent:] + 522
8 UIKit 0x000000010ef16958 -[UIWindow _sendTouchesForEvent:] + 735
9 UIKit 0x000000010ef17282 -[UIWindow sendEvent:] + 682
10 UIKit 0x000000010eedd541 -[UIApplication sendEvent:] + 246
11 UIKit 0x000000010eeeacdc _UIApplicationHandleEventFromQueueEvent + 18265
12 UIKit 0x000000010eec559c _UIApplicationHandleEventQueue + 2066
13 CoreFoundation 0x000000010e3a9431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
14 CoreFoundation 0x000000010e39f2fd __CFRunLoopDoSources0 + 269
15 CoreFoundation 0x000000010e39e934 __CFRunLoopRun + 868
16 CoreFoundation 0x000000010e39e366 CFRunLoopRunSpecific + 470
17 GraphicsServices 0x00000001125aaa3e GSEventRunModal + 161
18 UIKit 0x000000010eec88c0 UIApplicationMain + 1282
19 SHE. 1.0 0x000000010deefef7 main + 135
20 libdyld.dylib 0x00000001108fa145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
我知道这与我在 Storyboard 中将按钮与 Controller 连接的方式有关,但我是制作具有多个 View 的应用程序的新手,我不知道如何修复它 这是按钮运行的代码:
@IBAction func playButotonPressed(sender: UIButton) {
let carViewController = storyboard!.instantiateViewControllerWithIdentifier("GameViewController") as! GameViewController
}
最佳答案
您是否阅读了整个错误消息?我将从下面一行的末尾开始。
2015-08-30 04:14:49.304 SHE. 1.0[45317:3481211] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Storyboard (<UIStoryboard: 0x7fe958e45b80>) doesn't contain a view controller with identifier 'GameViewController''
UIStoryboard 不包含标识符为“GameViewController”的 View Controller 。
早期的按钮约束记录是一个单独的问题,与 Storyboard的实际问题无关。
关于ios - libc++abi.dylib : terminating with uncaught exception of type NSException in a game,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32292586/
我的瘦服务器配置了nginx,我的ROR应用程序正在它们上运行。在我发布代码更新时运行thinrestart会给我的应用程序带来一些停机时间。我试图弄清楚如何优雅地重启正在运行的Thin实例,但找不到好的解决方案。有没有人能做到这一点? 最佳答案 #Restartjustthethinserverdescribedbythatconfigsudothin-C/etc/thin/mysite.ymlrestartNginx将继续运行并代理请求。如果您将Nginx设置为使用多个上游服务器,例如server{listen80;server
这里有一个很好的答案解释了如何在Ruby中下载文件而不将其加载到内存中:https://stackoverflow.com/a/29743394/4852737require'open-uri'download=open('http://example.com/image.png')IO.copy_stream(download,'~/image.png')我如何验证下载文件的IO.copy_stream调用是否真的成功——这意味着下载的文件与我打算下载的文件完全相同,而不是下载一半的损坏文件?documentation说IO.copy_stream返回它复制的字节数,但是当我还没有下
我正在尝试解析一个文本文件,该文件每行包含可变数量的单词和数字,如下所示:foo4.500bar3.001.33foobar如何读取由空格而不是换行符分隔的文件?有什么方法可以设置File("file.txt").foreach方法以使用空格而不是换行符作为分隔符? 最佳答案 接受的答案将slurp文件,这可能是大文本文件的问题。更好的解决方案是IO.foreach.它是惯用的,将按字符流式传输文件:File.foreach(filename,""){|string|putsstring}包含“thisisanexample”结果的
如何将send与+=一起使用?a=20;a.send"+=",10undefinedmethod`+='for20:Fixnuma=20;a+=10=>30 最佳答案 恐怕你不能。+=不是方法,而是语法糖。参见http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html它说Incommonwithmanyotherlanguages,Rubyhasasyntacticshortcut:a=a+2maybewrittenasa+=2.你能做的最好的事情是:
1.错误信息:Errorresponsefromdaemon:Gethttps://registry-1.docker.io/v2/:net/http:requestcanceledwhilewaitingforconnection(Client.Timeoutexceededwhileawaitingheaders)或者:Errorresponsefromdaemon:Gethttps://registry-1.docker.io/v2/:net/http:TLShandshaketimeout2.报错原因:docker使用的镜像网址默认为国外,下载容易超时,需要修改成国内镜像地址(首先阿里
我对如何计算通过{%assignvar=0%}赋值的变量加一完全感到困惑。这应该是最简单的任务。到目前为止,这是我尝试过的:{%assignamount=0%}{%forvariantinproduct.variants%}{%assignamount=amount+1%}{%endfor%}Amount:{{amount}}结果总是0。也许我忽略了一些明显的东西。也许有更好的方法。我想要存档的只是获取运行的迭代次数。 最佳答案 因为{{incrementamount}}将输出您的变量值并且不会影响{%assign%}定义的变量,我
print"Enteryourpassword:"pass=STDIN.noecho(&:gets)puts"Yourpasswordis#{pass}!"输出:Enteryourpassword:input.rb:2:in`':undefinedmethod`noecho'for#>(NoMethodError) 最佳答案 一开始require'io/console'后来的Ruby1.9.3 关于ruby-为什么不能使用类IO的实例方法noecho?,我们在StackOverflow上
我刚刚安装了带有RVM的Ruby2.2.0,并尝试使用它得到了这个:$rvmuse2.2.0--defaultUsing/Users/brandon/.rvm/gems/ruby-2.2.0dyld:Librarynotloaded:/usr/local/lib/libgmp.10.dylibReferencedfrom:/Users/brandon/.rvm/rubies/ruby-2.2.0/bin/rubyReason:Incompatiblelibraryversion:rubyrequiresversion13.0.0orlater,butlibgmp.10.dylibpro
我有一个数组数组,想将元素附加到子数组。+=做我想做的,但我想了解为什么push不做。我期望的行为(并与+=一起工作):b=Array.new(3,[])b[0]+=["apple"]b[1]+=["orange"]b[2]+=["frog"]b=>[["苹果"],["橙子"],["Frog"]]通过推送,我将推送的元素附加到每个子数组(为什么?):a=Array.new(3,[])a[0].push("apple")a[1].push("orange")a[2].push("frog")a=>[[“苹果”、“橙子”、“Frog”]、[“苹果”、“橙子”、“Frog”]、[“苹果”、“
有没有办法让Ruby能够做这样的事情?classPlane@moved=0@x=0defx+=(v)#thisiserror@x+=v@moved+=1enddefto_s"moved#{@moved}times,currentxis#{@x}"endendplane=Plane.newplane.x+=5plane.x+=10putsplane.to_s#moved2times,currentxis15 最佳答案 您不能在Ruby中覆盖复合赋值运算符。任务在内部处理。您应该覆盖+,而不是+=。plane.a+=b与plane.a=