exc-bad-access

ObjC: BAD ACCESS when call blocks ^{} in later functions?

家住魔仙堡 提交于 2019-12-02 09:03:33
问题 Following this discussion, I've encountered a bad access issue; A loop has several steps: a, b, c, ... x, y, z: -(void)cycle:(float)delta{ [self stepA] [self stepB] // etc. [self stepZ] } At some point, step x does the following: // IRQ is an NSMutableArray // Self is a reference to the engine running the cycles [IRQ addObject:^{ NSLog(@"hello! %@", self); } ]; Later, step z is to process all "delayed" calls: for (int i = 0; i < [IRQ count]; i++){ void (^delayedCall)(void) = [IRQ

SKShapeNode producing crash sometimes on dealloc EXC_BAD_ACCESS

寵の児 提交于 2019-12-02 07:42:15
问题 In my main scene I create 4 walls with this method: -(void)createFirstWalls{ CGFloat maxY = CGRectGetMaxY(self.frame); Wall* wall1=[Wall wallWithRect:self.frame color:[self randomColor] position:maxY andSpeed:speed]; Wall* wall2=[Wall wallWithRect:self.frame color:[self randomColor] position:maxY+distance andSpeed:speed]; Wall* wall3=[Wall wallWithRect:self.frame color:[self randomColor] position:maxY+distance*2 andSpeed:speed]; Wall* wall4=[Wall wallWithRect:self.frame color:[self

Image is not fetching from database

巧了我就是萌 提交于 2019-12-02 07:16:47
I stored some images in my server. I used JSON for fetch remote data from server. When i was storing images in local database it was working. When i use json url it's not working. Im getting EXC_BAD_ACCESS error. code: Mysof.h file: @interface Mysof : NSObject{ NSInteger sofaId; NSString *sofa; NSString *rating; UIImage *photo; } @property (nonatomic,retain)NSString *sofa; @property (nonatomic, assign) NSInteger sofaId; @property (nonatomic, retain)NSString *rating; @property (nonatomic, retain) UIImage *photo; @end Mysof.m file: @implementation Mysof @synthesize sofId; @synthesize sofa;

Where is EXC_BAD_ACCESS documented? [closed]

眉间皱痕 提交于 2019-12-02 05:33:28
One of the more commonplace debugging errors in my own development (Mac, iOS) is EXC_BAD_ACCESS. Despite its commonness, its origin and precise meaning remain mysterious. Google lists many occurrences of the error, but the only explanation I could find is informal and incomplete. I know that this exception (if that's the proper term for it) means that the code has attempted to access an address to which it does not have read and/or write privileges—the null address, for example, or an address outside of the process's address space. But this is an intuitive interpretation based on my prior

NSAttributedString EXC_BAD_ACCESS KERN_INVALID_ADDRESS crash

流过昼夜 提交于 2019-12-01 21:27:29
问题 I am using NSAttributedString in my code. I am getting the below crash sometimes. Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000000114f2841 Raw 0 libobjc.A.dylib objc_msgSend + 5 15 UIFoundation -[NSAttributedString(NSAttributedStringUIFoundationAdditions) initWithData:options:documentAttributes:error:] + 116 Can somebody help me out on this?. Thanks in advance. 回答1: If you working with HTML strings in NSAttributedString it also may crash, as it said in docs: The

UIAlertView fails to show and results in “EXC_BAD_ACCESS” error

旧城冷巷雨未停 提交于 2019-12-01 20:52:49
A method is called when a return button on the keyboard is pressed. After calling another method which returns an integer a message is created based on that integer. The message is then passed into an UIAlterView and displayed to the user. The alert doesn't have any options (hence why I'm not calling a delegate), but simply notifies the user of what happened. Edit: Below is the full method (previously displayed partial). When I comment out everything before the UIAlertView and substitute the string @"test" instead of passing message the Alert is shown successfully. Am I not handling memory

drawRect:/renderInContext: issues

谁都会走 提交于 2019-12-01 14:37:14
Seem to be having a bit of an issue trying to draw my view into a context. My basic setup is, I have a view controller that owns a UIPageViewController in which I load controllers with views that can be drawn on by the users finger. Basically I have a book that can be drawn in. When the page is turned in the book I save the image by calling - (UIImage *)wholeImage { // Render the layer into an image and return UIGraphicsBeginImageContext(self.bounds.size); [self.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *wholePageImage = UIGraphicsGetImageFromCurrentImageContext();

EXC_BAD_ACCESS when I close my window, which is also my application's delegate

倾然丶 夕夏残阳落幕 提交于 2019-12-01 12:25:49
问题 I wrote a Cocoa Application and I got EXC_BAD_ACCESS error when I'm closing an application window. I read that this error usually means problems with memory, but I have ARC mode on and I don't need care about releasing e.t.c. (xCode forbids me to call this functions and manage memory automatically). Error is pointing at line return NSApplicationMain(argc, (const char **)argv); in main function. Here's my application's code: .h file: @interface MainDreamer : NSWindow <NSWindowDelegate> {

EXC_BAD_ACCESS on device, but fine on Simulator

杀马特。学长 韩版系。学妹 提交于 2019-12-01 09:19:48
I have a scroll view app which runs fine on the simulator, however, when installed on the device, it gives me an EXC_BAD_ACCESS, when i attempt to scroll one page. I have ran it through Instruments with Allocations and Leaks, but nothing is leaked and no zombies are messaged... i'm just curious what could cause such a difference in simulator vs device? Any ways to debug this, since my symbolicated crash log (partial below), doesn't seem to be very symbolicated. Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000f Crashed Thread: 0 Thread 0 Crashed: 0

UIPickerView EXC BAD ACCESS?

冷暖自知 提交于 2019-12-01 09:06:25
I keep getting a exc bad access error and I think it has something to do with my UIPickerView because this is when the app crashes. Everything works fine until I make a 9th choice from the UIPickerView. Every single time the app crashes on the 9th choice. Any ideas? - (void)viewDidLoad { [super viewDidLoad]; list = [[NSMutableArray alloc] init]; [list addObject:@"Anvil"]; [list addObject:@"Apple"]; [list addObject:@"Arrow"]; [list addObject:@"Baby"]; [list addObject:@"Basketball"]; [list addObject:@"Beehive"]; [list addObject:@"Blimp"]; [list addObject:@"Bomb"]; [list addObject:@"Bungee Jumper