exc-bad-access


Tracking down EXC_BAD_ACCESS without NSZombie?

时间秒杀一切 提交于 2020-01-25 01:22:16
问题 I've spent two days on this and I still can't find the cause of the crash. I know it has something to do with trying to access an object that has been freed but I don't know which access or which object. Whenever I google trying to find the source of EXC_BAD_ACCESS people suggest using NSZombies. The problem is when I enable zombies (either in xcode via environment variable or in instruments via ObjectAlloc properties) the program doesn't crash where it usually does and the zombies don't

EXC_BAD_ACCESS when copying or retaining Block

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-19 05:20:07
问题 As far as I understand a Block acts like an object, in that you can send copy or release messages to it, e.g: [myBlock copy]; However whenever I do this, or release a block, I get EXC_BAD_ACCESS. If I use the block functions, everything works as expected, e.g.: Block_copy(myBlock); I thought both ways of releasing and copying blocks were identical? It's not that much of a problem, but it is a little annoying that if I have a property (copy) which is a Block, I have to write the setter method

Swift: self.init (coder : aDecoder) is crashing app with EXC_BAD_ACCESS

徘徊边缘 提交于 2020-01-17 06:46:35
问题 Error is crashing app when using NSCoder and NSKeyArchiver. I had made a recent post around NSCoder but since then I've changed my code around and got a new error and decided a new post is best. The app is a blog reader, reading from a MYSQL database using PHP to fill a table view with custom objects in Swift using JSON. I've been trying to save mainArray so that when the user moves cells across sections (each section has an array) it can save where the user left it. Blog.swift: Handles the

ASIHTTPRequest dealloc and EXC_BAD_ACCESS problem

為{幸葍}努か 提交于 2020-01-13 19:28:37
问题 I'm using an array of ASIHTTPRequest wrappers (AsyncImageLoader) to download images for cells in a UITableView. I'm having problems handling ASIHTTPRequests lifetime. If I release them, I end up having a EXC_BAD_ACCESS if I keep scrolling up and down while they try to load images. Here's what my wrapper looks like. self.request has retain property, targetCell is the cell I want to put the image in: @implementation AsyncImageLoader - (void)loadImageFromURL:(NSString*)fileName target:

UIButton EXC_BAD_ACCESS error

不问归期 提交于 2020-01-06 18:37:08
问题 I have an UI button and it works correctly when I pressed. But if I press the button three times, I get an EXc_BAD_ACCESS error. I thought I release something in somewhere but I couldn't find the solution. Could you please help me? Kind regards. This is the function when I pressed the button. And in dealloc I release them. When I am tracking, it doesn't give the error in function. I got it after function, but I dont know where the code goes after this function. - (IBAction) doSomething: (id

I am getting EXC_BAD_ACCESS (code=1, address=0x30) Bad Access even when object exists - swift 4

风流意气都作罢 提交于 2020-01-06 07:26:14
问题 Similar to This SO Post and This SO Post I initialize a variable ----> idHERE: static func createPractitionerRole(fromRoleDict roleDict:[String: AnyObject])->PractitionerRole?{ guard let (nameL, idL) = getRoleNameId(fromRoleDict:roleDict) else { return nil } let roleTypeL = ProTouchRoleType.determineRoleTypeFromProTouchId(idL) var idHERE = Identifier(withValue: idL, systemParam:Constants.CodeSystem.ProTouch.coding_system_proTouchURL) print("idHERE \(String(describing: idHERE))") print("idHERE

What should I do to call audioPlayerDidFinishPlaying:

て烟熏妆下的殇ゞ 提交于 2020-01-06 05:40:10
问题 I wrote this source program . But I can't call audioPlayerDidFinishPlaying: method. After playing the sound, which crashes by "exc_bad_access" error after a few seconds. .h file #import <UIKit/UIKit.h> #import <AVFoundation/AVFoundation.h> @interface SecondViewController : UIViewController< AVAudioPlayerDelegate>{ AVAudioPlayer *aPlayer; } @end .m file -(void)playSound{ NSString *soundName = @"red"; NSError *error = nil; NSURL *soundUrl = [[NSBundle mainBundle] URLForResource:soundName

Adding, Removing, and Caching SKNodes

岁酱吖の 提交于 2020-01-05 04:42:12
问题 Background info: I'm creating a SpriteKit 2D platform-style game with multiple "floors". When the user enters a "portal" he is transported to another floor (either one up or one down). If the user dies at a different floor from where the most recent spawnpoint is, he is transported back to the floor with the spawnpoint. Problem: After upgrading to iOS8, this scenario causes the game to crash with an EXC_BAD_ACCESS exception/ error. Even after going through multiple tutorials on how to debug

EXC_BAD_ACCESS when using weakSelf in block / blocks

若如初见. 提交于 2020-01-04 05:25:41
问题 I have been struggeling with this issue for a while since i don't think i fully understand the retain cycles. I am totally new to this and i'm trying to learn more about it. I am getting the EXC_BAD_ACCESS message with the following code. I started using the weakSelf because i get 2 warnings about the retain cycle if i just use self.successBLock();. The exact warning is: Capturing 'self' strongly in this block is likely to lead to a retain cycle Maybe i shouldn't even bother using the weak

Connection Crash in mysql C++

社会主义新天地 提交于 2019-12-31 04:30:08
问题 Currently, I have implemented a program to write to a mysql database... I am using Xcode with c++as well. I have imported all the libraries correctly but I'm getting a BAD EXCESS error message on this line : con = driver->connect("tcp://127.0.0.1:3306", "root", "root"); What seems to be the issue? Heres the full program... #include <stdlib.h> #include <iostream> // Include directly the different // headers from cppconn/ and mysql_driver.h + mysql_util.h // (and mysql_connection.h). This will

工具导航Map