草庐IT

BAD_ACCESS

全部标签

ios - NSLocale NSLocaleCalendar 导致 EXC_BAD_ACCESS

我正在使用以下文档-https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSLocale_Class/index.html#//apple_ref/occ/clm/NSLocale/localeIdentifierFromComponents:如果链接没有跳转到页面的正确部分,请查找localeIdentifierFromComponents(_:)。XCode7.2Playgroundprint(NSLocale.localeIdentifierFromCom

ios - swift SpriteKit : Best practice to access UIViewController in GameScene

关闭。这个问题是opinion-based.它目前不接受答案。想要改进这个问题?更新问题,以便editingthispost可以用事实和引用来回答它.关闭6年前。Improvethisquestion我想看看从GameScene访问UIViewController方法的最佳实践是什么。现在我一直在使用NSNotificationCenter,但由于我想要实现的特定功能,我不想使用它。此外,如果没有任何其他方法可以通过GameScene访问UIViewController,那么我真正想知道的是一种能够在没有UIViewController的情况下在GameScene中呈现UIAlertC

iOS:AppDelegate 中的 Swift Access 按钮

ViewController.swift@IBOutletweakvarbtn_stop:UIButton!AppDelegate.swiftletviewController=UIStoryboard(name:"Main",bundle:nil).instantiateViewControllerWithIdentifier("ViewController")as!ViewControllerviewController.btn_stop.hidden=false错误-给我fatalerror和应用程序崩溃 最佳答案 通过roo

ios - Swift CoreData EXC_BAD_INSTRUCTION(代码=EXC_I386_INVOP,子代码=0x0)

我正在尝试使用CoreData,但每当我尝试存储对象时,我都会收到EXC_BAD_INSTRUCTION(代码=EXC_I386_INVOP,子代码=0x0)错误。可能导致此错误的原因是什么?附带说明一下,我最初创建项目时并没有打算使用CoreData,所以CoreData是我后来添加到我的项目中的东西(我不知道这是否是导致问题的原因)。lazyvarmanagedObjectModel:NSManagedObjectModel={//Themanagedobjectmodelfortheapplication.Thispropertyisnotoptional.Itisafatale

ios - EXC_BAD_ACESS 在 iOS8 上的 SpriteKit 中崩溃

我在尝试更改SKSpriteNode的位置时遇到了一个非常奇怪的崩溃。此崩溃发生在iOS8而不是iOS9。//ifthepowerupisfull,spawntheicononscreeniforangeBallsCollected==numberOfBallsRequiredToActivatePowerup{//addthepowerupicontothearrayofpowerupiconsonscreenpowerupIconsOnScreen.append(fewerColorsPowerupIcon)//setthelightingmaskofthepowerupicons

ios - 错误 - 线程 1 exc_bad_instruction(代码=exc_1386_invop 子代码=0x0)

我对这段代码有疑问-overridefuncdidReceiveMemoryWarning(){super.didReceiveMemoryWarning()//Disposeofanyresourcesthatcanberecreated.}funcget(){leturl=NSURL(string:"http://www..php")letdata=NSData(contentsOfURL:url!)values=try!NSJSONSerialization.JSONObjectWithData(data!,options:NSJSONReadingOptions.Mutable

ios - 如何为 NSURLRequest 设置 x-access-token?

如何为NSURLRequest设置x-access-token?这是我现在拥有的:varurl=NSURL(string:"url")!letauthorization="Bearer\(toke)"letrequest=NSMutableURLRequest(URL:url)request.addValue("Bearer\(toke)",forHTTPHeaderField:"X-Auth-Token")request.HTTPMethod="GET" 最佳答案 我想出了一个解决方案:letconfiguration=NSURL

Swift dispatch_async 导致 EXC_BAD_ACCESS 错误

在我的Swift项目中,我试图在后台线程中处理一个FIFO队列(我在这里将其称为列表以避免混淆)。当我使用dispatch_async时,它会在仅执行列表的某些部分后导致EXC_BAD_ACCESS错误。我已尽可能将代码简化为以下Playground代码。在playground中,当main_thread设置为true时,代码会处理列表中的所有100个项目。如果为假,则只会处理少数项目。如果代码在项目中,当main_thread为false时会出现EXC_BAD_ACCESS。显然,我也尝试过指定一个串行队列,但这似乎没有帮助。我缺少或不理解什么?谢谢。importUIKitletma

Access denied for user root @ localhost (using password: YES)

简述:在学习ssm时,某次打开idea,发现执行数据库的操作时会报如下错误:Connection;nestedexceptionisjava.sql.SQLException:Accessdeniedforuser'root'@'localhost'(usingpassword:YES)刚开始以为是我的配置文件写错了,经过多次检查,我意识到问题并不是这个。于是我找了很多帖子,发现叫修改配置文件,或者各种方法,但是我的问题还是不能得到解决。前前后后花了3个半小时,期间还经历了重装数据库,最后我发现重装连不能解决问题(重装也会在登陆时继续报改错)。在最后的迷茫之际,终于得到了解决,方法如下:1:打

ios - Swift 3 - 线程 1 : EXC_BAD_INSTRUCTION (code = EXC_I386_INVOP, 子代码 = 0x0)

我正在尝试使用AWSCognito作为后端将用户身份验证功能添加到我的应用程序中。到目前为止,每当我的应用程序尝试构建时我都会收到此错误,当它构建时它指向我的两个类中的这些错误。AWSMobileClient类:funcdidFinishLaunching(application:UIApplication,withOptionslaunchOptions:[NSObject:AnyObject]?)->Bool{print("didFinishLaunching:")letdidFinishLaunching=AWSIdentityManager.defaultIdentityMan