草庐IT

member-access

全部标签

iOS 应用因 EXC_BAD_ACCESS(代码=1,地址=0x0)而崩溃

我的代码中有一个我无法弄清楚的问题。当我运行我的应用程序时,有时它会加载我的手机,有时它会立即崩溃。我相信我的问题出在我的cellForRowInIndexPath上。我的错误在cellForRowInIndexPath行:cellDrawer.insertDescriptionLabel(cell,text:offer.title)这是我的错误:Thread1:EXC_BAD_ACCESS(code=1,address=0x0)这是我的代码:importUIKitclassProdutsViewController:UIViewController,UITableViewDelega

ios - Swift 中的 UIDocumentInteractionControllerDelegate EXC_BAD_ACCESS

我目前正在尝试使用另一个应用程序使用UIDocumentInteractionController实例打开一个文件。一切正常(例如显示选项对话框、打开应用程序)但是当应用程序切换实际发生时,我收到一个EXC_BAD_ACCESS而不是didFinishSendingToApplication:委托(delegate)回调。在我将此代码从Objective-C移植到Swift之前,一切都运行良好。知道这里出了什么问题吗?self.documentInteractionController=UIDocumentInteractionController(URL:self.fileURL)s

ios - swift 错误 : Value of type 'NSObject -> () ' AnimalListTableViewController' has no member 'tableView'

我正试图在swiftxcode中消除这些错误如果截图太小,这里是代码importUIKitclassAnimalListTableViewController:UITableViewController{overridefunctableView(tableView:UITableView,numberOfRowsInSectionsection:Int)->Int{return4}letindexPath=self.tableView.indexPathForSelectedRow()//thisiswheretheerrorappears,itsaysValueoftype'NSO

ios - 新 Xcode 7.3 : Swift NSDate extension with nullable convenience init crashes EXC_BAD_ACCESS

我有这个带有可为空初始化的NSDate扩展,它一直运行良好,直到我更新到新发布的Xcode7.3。现在它因EXC_BAD_ACCESS而崩溃。extensionNSDate{convenienceinit?(dateString:String,formatString:String?){letdateFormatter=NSDateFormatter()dateFormatter.dateFormat=formatStringletnewDate:NSDate?=dateFormatter.dateFromString(dateString)ifletnewNewDate=newDat

swift - Xcode8 Beta 创建弱引用时出现EXC_BAD_ACCESS 错误

以下代码复制自WeakReferencessectionoftheOfficialdocumentclassPerson{letname:Stringinit(name:String){self.name=name}varapartment:Apartment?deinit{print("\(name)isbeingdeinitialized")}}classApartment{letunit:Stringinit(unit:String){self.unit=unit}weakvartenant:Person?deinit{print("Apartment\(unit)isbeing

Gitee push错误 Access denied: You do not have permission to push to the protected branch ‘master‘ via

错误:首次使用gitee向别人的repo提交代码,发现出现权限问题无法push到master,提交命令如下:gitpush-uoriginmaster:master错误信息如下: 分析解决:查看repo的分支信息,发现master分支是保护分支,管理员才能push,而我的账户是开发者权限。只能提交到feature,或自建的分支。 提交到feature分支的命令:gitpush-uoriginmaster:feature

Linux下报错MySQL Access denied for user ‘root‘@‘localhost‘ (using password: YES)解决方案

1.先进入root模式2.进入#vim/etc/my.cnf在[mysqld]后面任意一行添加“skip-grant-tables”用来跳过密码验证的过程,保存退出3.systemctlrestartmysql#重启服务 或者  servicemysqldrestart#重启服务4.mysql-uroot-p没有密码可以直接进入5.updatemysql.usersetauthentication_string=PASSWORD('你的新密码')whereUSER='root';6.flushprivileges;#刷新权限表7.再次vim/etc/my.cnf删除添加的skip-grant-

ios - 初始化变量 : 'self' captured by a closure before all members were initialized

我在初始化自定义类时遇到问题。当初始化更新属性的类时,我需要在一些数据上设置一个观察者。最初,属性可以为空,这就是我在启动时设置它们的方式。但是,Xcode仍然会抛出“在所有成员初始化之前由闭包捕获的‘self’”错误。这是代码的简化版本。classFoo{init(){self.usersRef=ref.child("users")self.usersRef.observe(DataEventType.value,with:{(snapshot)in//snapshoterrorchecking//usersis[String]self.users=users})}privateva

IOS FoodTracker 教程 : Value of tuple type '()' has no member 'path'

我正在完成IOSSwift教程“FoodTracker”,但是有一个错误我可以找到解决方案,但我不明白哪里出了问题以及如何解决它:错误:Valueoftupletype'()'hasnomember'path'此错误在以下代码中针对变量“Meal.ArchiveUrl.path”显示。我的代码,在MealtableViewController(相当于IOS教程):privatefuncsaveMeals(){letisSuccessfulSave=NSKeyedArchiver.archiveRootObject(meals,toFile:Meal.ArchiveUrl.path)if

ios - 找不到成员(member)下标

我正在尝试执行以下代码并收到错误Couldnotfindmember'subscriptonXcode6varb:[[Float]]=[[1,2]]vari2=0//secondtolastcontrolpointvarpointIm1=CGPoint(x:0.0,y:0.0)varpointI=CGPoint(x:0.0,y:0.0)varpointIp1=CGPoint(x:0.0,y:0.0)varpx:Float=b[0][0]*Float(pointIm1.x)+b[0][0]*Float(pointI.x)+b[0][0]+b[0][0]*Float(pointIp1.x)