exc-bad-access

EXC_BAD_ACCESS when setting Integer to anything else than zero

心不动则不痛 提交于 2019-12-08 08:22:52
问题 I have this object: @interface Song : NSManagedObject @property (nonatomic, strong) NSString *songName; @property (nonatomic) int32_t achievedPoints; When I set the properties like this Song *song1 = [[SongStore sharedStore] createSong]; song1.songName = @"Song 1"; song1.achievedPoints = 0; everything works, however once I try to set the achievedPoints variable to something else than 0 I get an EXC_BAD_ACCESS. This is what the createSong method does: - (Song *)createSong { double order; if (

EXC_BAD_ACCESS on ExtAudioFileWriteAsync

倖福魔咒の 提交于 2019-12-08 07:16:29
问题 I have added the following code at the end of the Mic / Line In Audio Rendering Callback. But the app keeps crashing with EXC_BAD_ACCESS on : err = ExtAudioFileWriteAsync(mOutputAudioFile, inNumberFrames, ioData); The rest of the code is as follows : ExtAudioFileRef mOutputAudioFile; AudioFileID mAfid; NSLog(@"Writing output to file ...."); NSArray *dirPaths; NSString *docsDir; dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); docsDir = [dirPaths

EXC_BAD_ACCESS while working with Core Data

て烟熏妆下的殇ゞ 提交于 2019-12-08 07:06:47
问题 I'm new into Cocoa and am writing a simple app to learn working with Core Data, but it crashes with EXC_BAD_ACCESS . Tried several things and haven't find the solution yet. As I said, I'm not very experienced in Cocoa. I have followed the usual Core Data tutorials. This is my Model: I've added these two entities as NSArrayController in my Nib file and have two NSTableView s with Value Binding to the entity objects. And here's the code: - (void)applicationDidFinishLaunching:(NSNotification *

iOS EXC_BAD_ACCESS error

守給你的承諾、 提交于 2019-12-08 04:37:43
问题 My application was working fine, and a couple minutes later, after editing another part of the app, it started throwing the EXC_BAD_ACCESS error from a view controller that I wasn't even working on. The only thing I did between that I can think that may have affected it is, I Edit->Refractor->Convert to Obj-C ARC... I only did it it for a specified file also, not my whole project which is confusing. I was following this tutorial when I believe the error started happening... http://sonnyparlin

EXC_BAD_ACCESS when setting Integer to anything else than zero

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 02:17:27
I have this object: @interface Song : NSManagedObject @property (nonatomic, strong) NSString *songName; @property (nonatomic) int32_t achievedPoints; When I set the properties like this Song *song1 = [[SongStore sharedStore] createSong]; song1.songName = @"Song 1"; song1.achievedPoints = 0; everything works, however once I try to set the achievedPoints variable to something else than 0 I get an EXC_BAD_ACCESS. This is what the createSong method does: - (Song *)createSong { double order; if ([allSongs count] == 0) { order = 1.0; } else { order = [[allSongs lastObject] orderingValue] + 1.0; }

Getting “Thread 1:EXC_BAD_ACCESS” error?

為{幸葍}努か 提交于 2019-12-07 18:30:00
问题 I am creating a simple web viewer using WKWebView and the Swift language. Here is my code. import Cocoa import WebKit @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet var containerView : NSView! = nil @IBOutlet weak var window: NSWindow! func applicationDidFinishLaunching(aNotification: NSNotification) { // Insert code here to initialize your application var webView: WKWebView webView = WKWebView() //Thread 1:EXC_BAD_ACCESS (code=1,address=0x20) var url =

Segmentation Fault 11 When Using File I/O C++

蹲街弑〆低调 提交于 2019-12-07 17:15:49
问题 I am having an issue with Code Blocks and Xcode on my Mac. Every time I run the code on Code Blocks I receive Segmentation Fault 11 and when I try on Xcode I receive Thread 1: exc_bad_access (code=1 address=0x0xffffffff0000000a). However, if I run this code on a PC via Code Blocks it runs. Does anybody know how to solve this so I can run the program on my Mac. #include <iostream> #include <fstream> #include <cstdlib> using namespace std; struct Book { string isbn; string title; string author;

ARC: EXC_BAD_ACCESS when calling a method from inside a block, inside a delegate method

孤人 提交于 2019-12-07 07:10:14
问题 I created a block, inside a delegate method and I am using it to call a static method in another class. I am getting an EXC_BAD_ACCESS error even when I have NSZombies enabled. There are a few posts on here about similar problems - I think this one is the closest: ARC: Getting EXC_BAD_ACCESS from inside block used in delegate method But, I haven't found anything so far that has helped. Here is the code: @interface MyClass() @property (nonatomic, copy) CaseBlock c; @end .... //NSURLConnection

SecKeyGetBlockSize or SecKeyRawVerify for Public Key throw EXC_BAD_ACCESS code=2

眉间皱痕 提交于 2019-12-07 05:06:19
问题 Upon trying to implement Security.Framework SecKeyRawVerify iOS function from Apple's example, programm halts with bad pointer error (EXC_BAD_ACCESS code=2). Any help or suggestions would be appreciated. Here is my code: - (BOOL)verifySignature:(NSData *)plainText signature:(NSData *)sig { size_t signedHashBytesSize = 0; OSStatus sanityCheck = noErr; SecKeyRef publicKeyA = NULL; NSMutableDictionary * queryPublicKeyA = [[NSMutableDictionary alloc] init]; NSData * publicTag = [NSData

Core Data: solve a strange EXC_BAD_ACCESS error

本秂侑毒 提交于 2019-12-07 03:07:52
问题 I am facing a really strange problem with Core Data. Let's describe it: Definitions Let's say I have two models, ModelA and ModelB . In the data model ModelA has a reference to ModelB as a one-to-many association, and consequently ModelB has a one-to-one association with ModelA . Update When the application launches (especially at first launch), or when the user asks, I have to create or update all the ModelB instances for each ModelA instance. ModelA instances are predetermined. For each