exc-bad-access

iOS UITableView numberOfRowsInSection in tableView heightForRowAtIndexPath give BAD ACCESS

感情迁移 提交于 2019-12-13 20:55:32
问题 I have receive a EXC Bad Access error when I enter the if statement below [tableView numberOfRowsInSection:0] .I'm calculating the tableView numberOfRowsInSection of the UITableView inside the heightForRowAtIndexPath . I have got following code to set height for last row of first section -(CGFloat )tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ if (indexPath.section==0) { NSInteger lastRowIndex = [tableView numberOfRowsInSection:0] - 1; if (indexPath.row=

Finding the cause of EXC_BAD_ACCESS

泄露秘密 提交于 2019-12-13 17:08:58
问题 I have a class with the following init method: - (id)init { self = [super init]; if (self) { // Initialization code here. StateStack* s = [[StateStack alloc] init]; state = s; [s push:NONE]; //<--EXC_BAD_ACCESS on load here [s release]; } return self; } And StateStack has the following init code: - (id)init { self = [super init]; if (self) { NSMutableArray* s = [[NSMutableArray alloc] init]; stack = s; [s release]; NSLog(@"%d",[stack retainCount]); } return self; } Oddly, if I remove the

EXC_BAD_ACCESS error for NSManagedObject implementing a protocol in Swift

风流意气都作罢 提交于 2019-12-13 14:32:36
问题 I have the following two methods: func isAuthenticated() -> Bool { var currentUser: CurrentUser? = self.getCurrentUser() if currentUser == nil { return false } self.token = getUserToken(currentUser!.username) if self.token == nil { return false } if !tokenIsValidForUser(self.token!, user: currentUser!) { return false } return true } func tokenIsValidForUser(token: AuthenticationToken, user: UserObject) -> Bool { if token.username != user.username { return false } return true } When I call

iOS app crashes exc_bad_access during splashscreen

一世执手 提交于 2019-12-13 11:07:55
问题 Before I even able to insert any breakpoints in the appdelegate.m... App does work in simulator but not on ipod touch. sometimes it does run, i'm unsure how to reproduce successful runs... here's debug log: dyld: loaded: /var/mobile/Applications/D7F06B5F-7D51-45C7-8344-B9CD9CD348D9/PagerPlus.app/PagerPlus dyld: loaded: /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration dyld: loaded: /usr/lib/libSystem.B.dylib dyld: loaded: /System/Library/Frameworks/AudioToolbox

Why did happen EXC_BAD_ACCESS and SIGABRT when set integer? [closed]

寵の児 提交于 2019-12-13 09:14:19
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I wrote code. I want to save integer using nsuserdefault. But this code happen EXC_BAD_ACCESS and SIGABRT. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { ... [self desave:[newys integerValue] :[newms integerValue]]; ... } ... - (void)desave:(NSInteger*)year :

Unarchiving .sks file in Swift for iOS 7.1

丶灬走出姿态 提交于 2019-12-13 05:50:50
问题 I have an app which loads nicely from an .sks file in iOS 8 using the following extension: class func unarchiveFromFile(file : NSString) -> SKNode? { if let path = NSBundle.mainBundle().pathForResource(file as String, ofType: "sks") { var sceneData = NSData(contentsOfFile: path, options: .DataReadingMappedIfSafe, error: nil)! var archiver = NSKeyedUnarchiver(forReadingWithData: sceneData) archiver.setClass(self.classForKeyedUnarchiver(), forClassName: "SKScene") let scene = archiver

MKMapView causes EXC_BAD_ACCESS when testing only

瘦欲@ 提交于 2019-12-13 05:23:38
问题 when testing on device only, i am getting EXC_BAD_ACCESS. This does not happen when i just run the app. I am concerned my users will experience the crash even though i am not when not testing. Anyone have any ideas why? It does not seem related to my annotations, as i comment out the adding of annotations and it still crashes. Also, it loads on first view of the map, but when i navigate back to my collection view , then back to this view is when it crashes. My coordinates also seem valid

SpriteKit: EXC_BAD_ACCESS SpriteKit`SKCShapeSprite::getAccumulatedBounds() crash

不问归期 提交于 2019-12-13 05:04:50
问题 After upgrading to iOS8, SpriteKit game crashes with EXC_BAD_ACCESS. It happens for no apparent reason, after playing a bit, at random time. No info from Exception breakpoint and NSZombie detection, so no way to detect the line in the code that causes the error. Checked both on a simulator and a device. The backtrace: * thread #1: tid = 0x13fa2, 0x2b3977f0 SpriteKit`SKCShapeSprite::getAccumulatedBounds() const + 84, queue = 'com.apple.spritekit.renderQueue', stop reason = EXC_BAD_ACCESS (code

UInt8 EXC_BAD_ACCESS

纵饮孤独 提交于 2019-12-13 04:50:16
问题 I have a method that will add a filter to an image. This worked fine until a couple of months ago, now when I try to use this method the application will crash on the images buffer. I create the buffer and set it to the image's data, accessing the specific index later causes a bad access crash. I have looked for the past hour or two, and now I am convinced there is something im overlooking. I think something is being released that should not be. I am using the ios DP 4 preview of xcode, and I

Perhaps the weirdest EXC_BAD_ACCESS I've seen Swift generate

放肆的年华 提交于 2019-12-12 18:23:27
问题 I have a set of classes forming a decorator pattern so that I can do some layered caching. I have an abstract class which provides the core processing of images and contains a number of overridable functions where implementations can add their individual processing. When saving an image I have the following code: func cacheImage(_ key:String, image:UIImage?) { if let image = image { saveImage(key, image:image) } else { deleteImage(key) } backingCache?.cacheImage(key, image:image) } func