草庐IT

found_iterID

全部标签

swift - 在 swift 中解析 JSON 抛出 'fatal error: unexpectedly found nil while unwrapping an Optional value'

我正在尝试获取json对象,但无法获取这是我的代码funcloadShots(completion:((AnyObject)->Void)!){varurlString="http://ip.jsontest.com/";letsession=NSURLSession.sharedSession()letshotsUrl=NSURL(string:urlString)vartask=session.dataTaskWithURL(shotsUrl!){(data,response,error)->Voidiniferror!=nil{println(error.localizedDes

ios - Xcode - IB 可设计 : Failed to render and update auto layout (no suitable image found)

我正在尝试从.xib文件实现自定义UIView,我希望能够在我的Storyboard之一中检查该文件。但是,我收到构建时错误:IBDesignables:FailedtorenderandupdateautolayoutstatusforLoginViewController(BYZ-38-t0r):dlopen(App.app,1):nosuitableimagefound.Didfind:App.app:can'tmapunslidablesegment__TEXTto0x100000000withsize0x268000我正在使用CocoaPods,并且读到这是由于1.5版中的一

ios - fatal error : unexpectedly found nil while unwrapping an Optional value using AVAudio

我有两个项目,使用相同的代码,但下面一行:player=AVAudioPlayer(contentsOfURL:NSURL(string:fileLocation),error:&error)仅在一个项目中返回此错误:fatalerror:unexpectedlyfoundnilunwrappinganOptionalvalue另一个项目运行没有错误。我正在尝试播放声音。importUIKitimportAVFoundationclassViewController:UIViewController{varplayer:AVAudioPlayer=AVAudioPlayer()over

swift - SceneKit—— fatal error : unexpectedly found nil while unwrapping an Optional value when getting child node

所以我试图在我的SceneKit/Swift项目中使用3D对象(.dae1.4,使用Cinema4Dr13导出)。我留下了提供的代码并进行了更改:letscene=SCNScene(named:"art.scnassets/ship.dae")!适合我的:letscene=SCNScene(named:"art.scnassets/pyramid.dae")!我确实也将文件导入到它应该位于的项目中(在art.scnassets中)。我可以像默认飞船一样预览文件,所以这应该是正确的。我也改了:letship=scene.rootNode.childNodeWithName("ship",

ios - Swift:比较隐式展开的可选结果为 "unexpectedly found nil while unwrapping an Optional values"

如果得到这个类并且想根据值比较它的实例classLocationOption:NSObject{varname:String!varradius:Int!varvalue:String!overridefuncisEqual(object:AnyObject?)->Bool{ifletotherOption=objectas?LocationOption{return(self.name==otherOption.name)&&(self.radius==otherOption.radius)&&(self.value==otherOption.value)}returnfalse}}

ios - 错误 : File not found while importing file from framework

我正在关注这个DemoTutorialURL在cartoDb提供的map上添加图层。我有WhirlyGlobe_Maply_Distribution_2_4二进制文件及其框架并导入其组件文件。但它告诉我找不到该文件。这是我为导入它而写的:#import请帮忙。我想在我的应用程序中使用它。谢谢 最佳答案 第1步-转到项目>常规>链接框架和库第2步-选择MaplyComponentFramework并将其删除。第3步-在嵌入式二进制文件的正上方,只需单击那里的“+”并添加MaplyComponentFramework。第4步-当您添加它

swift - 线程 10 : Fatal error: Unexpectedly found nil while unwrapping an Optional value

我正在尝试进行服务调用以获取用户详细信息,但出现此错误:线程10:fatalerror:在展开可选值时意外发现nil从这段代码:leturlString="http://myURL.com/getInfo/getAccountTransactions/{accountPublicKey}"print(urlString)letrequestUrl=URL(string:urlString)letrequestURL=URLRequest(url:requestUrl!)当我将代码包装在一个守卫中时,让代码不会被执行,因为它发现nil,我不确定为什么,因为URL字符串永远不会是nill,

ios - 比特币 : GoogleMaps framework not found issue

我正在使用Bitrise生成构建并将其上传到AppStore。当我在设备上运行应用程序或生成构建并通过Xcode上传到AppStore时没有出现任何错误,但是当我尝试通过Bitrise执行相同的过程时,它没有显示❌ld:frameworknotfoundGoogleMaps❌clang:error:linkercommandfailedwithexitcode1(use-vtoseeinvocation)Thefollowingbuildcommandsfailed:Ld/Users/vagrant/Library/Developer/Xcode/DerivedData/-dieokl

uitableview - fetchedResultsController核心数据 fatal error : unexpectedly found nil while unwrapping an Optional value

我知道有无数的问题都出现了同样的错误,但似乎没有一个解决方案有效。我想制作一个博客阅读器应用程序,用于从CoreData保存和获取数据。我能够将JSON结果保存到CoreData中,但是当我尝试检索它以在tableView中显示时,它崩溃并显示fatalerror:unexpectedlyfoundnilwhileunwrappinganOptionalvalueonlineletentity=NSEntityDescription.entityForName("博客",inManagedObjectContext:self.managedObjectContext!)这是我的代码:i

ios - mapView.addAnnotation() 表示 "unexpectedly found nil while unwrapping an Optional value"

我尝试从tableView单元格的地址转到mapView并在map上显示图钉。我确定我的代码中的所有内容都不为零。但是Xcode说我的oldValue是nil(在didSet{}中)。我不知道如何解决它。以下是我的代码:classMapViewController:UIViewController,MKMapViewDelegate{@IBOutletweakvarmapView:MKMapView!{didSet{mapView.mapType=.StandardmapView.delegate=self}}varlocation:CLLocation?{didSet{clearWa