草庐IT

ios - 这是在说什么布局约束?

我已经阅读了所有与此类似的SO问题,但我很迷茫。我收到以下错误:2015-09-1422:59:40.455guess-who[60143:9602686]Unabletosimultaneouslysatisfyconstraints.Probablyatleastoneoftheconstraintsinthefollowinglistisoneyoudon'twant.Trythis:(1)lookateachconstraintandtrytofigureoutwhichyoudon'texpect;(2)findthecodethataddedtheunwantedconst

ios - Swift JSON 错误,无法将类型 '__NSArrayM' (0x507b58) 的值转换为 'NSDictionary' (0x507d74)

我正在尝试从url(json文件)中获取数据,但在这些行中出现此错误:varjsonResult=NSJSONSerialization.JSONObjectWithData(data,options:NSJSONReadingOptions.MutableContainers,error:&err)as!NSDictionaryif(err!=nil){println("JSONError\(err!.localizedDescription)")}错误说Thread6:signalSIGABIRT-Couldnotcastvalueoftype'__NSArrayM'(0x518b

ios - 'NSUnknownKeyException',原因 : '[<ViewController 0x8a45930> setValue:forUndefinedKey:]:

这个问题在这里已经有了答案:Xcode-Howtofix'NSUnknownKeyException',reason:…thisclassisnotkeyvaluecoding-compliantforthekeyX"error?(78个答案)关闭7年前。当我在iPhone模拟器上运行我的第一个“sqlite”应用程序时出现此错误。xcode说没问题,但是当我点击我的应用程序时,它会在调试窗口中抛出错误。我在这里放置了所有必要的代码,请帮助我连接“sqlite”并删除这些错误。错误如下:Terminatingappduetouncaughtexception'NSUnknownKeyE

iOS 崩溃,EXC_BREAKPOINT,Xcode 6.1 无线索

我通常能够解决崩溃问题,但在这里我不知道它是从哪里来的。我使用解析,我只是在后台用完成block做一个请求。该应用程序在一个简单的if条件下崩溃,我几乎无法识别任何东西,无法打印描述,......你有什么主意吗?一个起点?任何事物?Xcode6.1真的很奇怪,似乎调试器有问题。这是崩溃的日志:Thread0name:Dispatchqueue:com.apple.main-threadThread0Crashed:0libsystem_kernel.dylib0x000000019657a964__kill+81MyAPP0x00000001001f2b700x10009c000+14

ios - 将 HTML 转换为属性字符串时 NSAttributedString 崩溃

我遇到这样一种情况,tryNSAttributedString(data:data,options:[NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType],documentAttributes:nil)使应用程序崩溃。在控制台中它说:void_prepareForCAFlush(UIApplication*__strong)()断言失败该函数在extensionString中调用。当我在控制台中“po”值时:(lldb)poselfObfuscatedstring\n(lldb)podata`450bytescount:450p

ios - Swift:以 NSException 类型的未捕获异常终止

我正在开发一个简单的应用程序,当我点击为用户注册时,该应用程序被终止。请帮我解决这个问题。它说:Terminatingappduetouncaughtexception'NSUnknownKeyException',reason:'[setValue:forUndefinedKey:]:thisclassisnotkeyvaluecoding-compliantforthekeyCreditCardTextField.'这里是更详细的错误:015-06-0422:42:57.661ParseStarterProject[43853:4461316]UnknownclassRegiste

ios - 如何正确推送 JSQMessagesViewController

我有一个Swift项目,我正在尝试在其中使用JSQMessagesViewController。我已经使用cocoapods安装框架并使用swiftimport语句导入它。importJSQMessagesViewController到目前为止,没有任何错误,所有内容都可以在没有警告的情况下编译。但是,当我尝试将新实例推送到导航Controller时,应用程序崩溃了。funcopenConversation(userId:Int){letmessageViewController=JSQMessagesViewController();self.navigationController

ios - 在 Swift 中,为什么 "let _ = this"比 "this != nil"快?

所以我的问题是为什么let_=this比this!=nil快?例子:这是:letthis:Bool?=true//letstart=DispatchTime.now()for_in0...100000000{guardthis!=nilelse{continue}}letend=DispatchTime.now()letnanoTime=end.uptimeNanoseconds-start.uptimeNanosecondslettimeInterval=Double(nanoTime)print("Time\(timeInterval)")//Time5426559135.0//T

ios - AVFoundation 元数据对象类型

我正在尝试使用AVFoundation通过以下代码读取条形码,但我不断收到以下错误。帮助解释为什么会非常感激。提前致谢!//Createcameraviewsession=AVCaptureSession()varlayer=self.cameraView.layervidLayer=AVCaptureVideoPreviewLayer.layerWithSession(session)asAVCaptureVideoPreviewLayervidLayer.frame=self.cameraView.boundsvidLayer.videoGravity=AVLayerVideoGr

iOS 测试因 waitForExpectationsWithTimeout 而崩溃

waitForExpectation测试随机崩溃,总是在我满足dispatch_after中的期望时发生。它发生在objective-c和swift中。完全随机,有时有效有时无效。有人有什么主意吗?(我在MacMini上使用CMD+U运行它,但我也尝试使用MBPRetina,结果相同)示例代码:functestBarcodeNotFound(){letexp=self.expectationWithDescription("storeloading")OHHTTPStubs.stubRequestsPassingTest({(request:NSURLRequest!)->Boolin