草庐IT

fatal_handler

全部标签

ios - Swift - 获取国家列表 -> fatal error : Can't unwrap Optional. 无

我几天前问过如何在Swift中获取国家列表,你解决了它的第一部分(这里:Swift-Getlistofcountries),但我无法获得最终的国家列表,因为它给出了一个错误:varcountries:NSMutableArray=NSMutableArray()countries=NSMutableArray(capacity:(NSLocale.ISOCountryCodes().count))forcountryCode:AnyObjectinNSLocale.ISOCountryCodes(){letdictionary:NSDictionary=NSDictionary(obj

ios - 在 Swift ios 中使用 vImageBuffer_initWithCGImage 时出现 "fatal error: unexpectedly found nil while unwrapping an Optional value"

我正在使用SwiftiOS8并尝试将UIImage转换为vImage_Buffer以使用Accelerate.framework执行操作。我正在尝试使用vImageBuffer_initWithCGImage进行转换,这是我尝试过的代码:funcinitvImageBufferwithUIImage(image:UIImage)->vImage_Buffer{varCGImg:CGImageRef=sunset.CGImagevarinProvider:CGDataProviderRef=CGImageGetDataProvider(CGImg)varinBitmapData:CFDa

xcode - 准备继续查看 Controller 时出现 fatal error

我目前在destViewController.titleLabel.text="TestingSegue"处收到一个fatalerror,意外发现nil,同时展开一个可选值。我该如何修复它,因为它在转到SecondViewController时出现错误?如何避免在titleLabel.text处得到nil?classViewController:UIViewController{@IBActionfuncaction(sender:AnyObject){letalertController:UIAlertController=UIAlertController(title:"NextP

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 - swift - fatal error : Array index out of range

我正在尝试用每个增加0.1的数字填充一个数组,例如:[0.1,0.2,0.3...]此代码给我错误:fatalerror:数组索引超出范围。我错过了什么?我觉得我在声明错误。我会把它存成Double类型的结构。我的代码importUIKitclassPrecoDomicilioViewController:UIViewController,UIPickerViewDelegate,UIPickerViewDataSource{@IBOutletvareuros:UIPickerView!varpickerData:[Double]=[]overridefuncviewDidLoad()

ios - swift 错误 : fatal error: Cannot index empty buffer

我是Swift语言的新手。我创建了一个MapKit应用程序,它从Sqlite数据库(最新的FMDB堆栈)中递归地检索MKPointAnnotation数据(纬度、日志和标题)。目的是把一堆兴趣点放在一个MKMapViewDelegate上。我尝试过不使用数组,但mapView.addAnnotation会覆盖任何点并仅显示map上的最后一个点,因此我正在尝试使用数组。我已经创建了一个函数,但是当调用wpoint数组时,我在运行时收到错误“fatalerror:无法索引空缓冲区”。代码如下:funcinitializeRoute(){sharedInstance.database!.op

ios - NSURLRequest swift 获取 fatal error 异常

我是swift代码的新手。当我将我的api传递给NSMutableRequest时出现以下错误。我的错误是什么。我的代码是我的urlString是http://185.43.139.198/N********e/mer***se?wt=json&c=Chennai&s=ddrrssleturlRequest=NSURLRequest(URL:NSURL(string:urlString)!)并且正在获取日志控制台作为fatalerror:unexpectedlyfoundnilwhileunwrappinganOptionalvalue 最佳答案

ios - SwiftUI -> 线程 1 : Fatal error: No observable object of type MyObject. 找到类型(工作表中的 EnvironmentObject)

我正在使用SwiftUI构建应用程序。当我尝试显示工作表(以前是模态)时,出现此错误消息:Thread1:Fatalerror:NoobservableobjectoftypeBixiStationCombinedListViewModel.Typefound.AView.environmentObject(_:)forBixiStationCombinedListViewModel.Typemaybemissingasanancestorofthisview.当我使用@State变量显示包含使用MapKit的MapView的模态时,会发生此错误。我不明白为什么以及如何实现一个新的环境

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

ios - fatal error : subscript: subRange extends past String end Xcode

我正在构建一个同时使用firebase和parse的应用程序,由于某种原因我不断收到fatalerror:fatalerror:subscript:subRangeextendspastStringend不知道为什么我一直收到这个;/我尝试进行搜索,但一无所获。谢谢。 最佳答案 它有点类似于“数组索引超出范围”,但对于字符串。letstr="qwertyui"varstr1="qwer"//length=4letind=advance(str.startIndex,6)//equals6str1[ind]//fatalerror:s