nszombie

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

respondsToSelector send to deallocated object

偶尔善良 提交于 2019-12-12 08:54:44
问题 I try to find out why my app crashes (RSS Reader) if I send a wrong URL to NSXML Parser. I got an EXC_BAD_ACCES S. So after some Searching I found out that I have to use Zombies. So I added the following arguments to the environment: CFZombieLevel = 3 NSMallocStaclLogging = YES NSDeallocateZombies = NO MallocStackLoggingNoCompact = YES NSZombieEnabled = YES NSDebugEnabled = YES NSAutoreleaseFreedObjectCheckEnabled = YES I also added malloc_error_break as breakpoint. Then I added some other

Understanding zombie trace in Instruments

会有一股神秘感。 提交于 2019-12-12 01:45:29
问题 I am kind of new at ios development and my app crashes because of EXEC_BAD_ACCESS. To detect problem i enabled Zombies and trace Allocations by using Instruments in xCode 4.5 After it detects Zombie Messaged i am having trouble to find which part of code crashes. Here is the instruments screen shot: Thanks for any help. 回答1: I also have the problem at the beginning of learning Instruments, then I figured out the I have to open the 'Extended detail' Pane to see it.(There might other easy way

NSZombie Enabled but Still No Debug Info

丶灬走出姿态 提交于 2019-12-11 17:40:16
问题 All of a sudden an app I've been developing is no longer outputting debug info to the console even though NSZombie is properly configured. I'm on Xcode 4.5 and tried this on iOS 5 and 6. Any clues what may be wrong here? 回答1: Some hints: - Ensure that project in Debug mode: Product - Edit scheme... => Build configuration = Debug - Add Exception break point: Switch to Breakpoint Navigator and Add Exception Breakpoint [Exception: Objective-C] 来源: https://stackoverflow.com/questions/12716737

Error 0x1c8250: double free memory in iphone

二次信任 提交于 2019-12-11 13:54:03
问题 I am facing the error of "error for object 0x1c8250: double free" when delloc for my controller is called. I causes some memory issues. Kindly guide me about this error. What is the best thing to do to prevent this error. 回答1: Check out the answer to this question. Somewhere in your code you have a [obj release] that is incorrect. 来源: https://stackoverflow.com/questions/2424026/error-0x1c8250-double-free-memory-in-iphone

Zombie when calling completion block in background thread

旧巷老猫 提交于 2019-12-11 05:08:56
问题 I pass a completion block to my method, this completion block will be called in the background when a network request is finished. Unfortunately, if the calling object is deallocated in the meantime, the app crashes: ViewController (which may be deallocated because it's popped from the navigation stack) code: __unsafe_unretained ViewController *weakSelf = self; [[URLRequester instance] sendUrl:url successBlock:^(id JSON) { [weakSelf webserviceCallReturned:JSON]; }]; URLRequester-Code (made

Objective C: Where to find <process id> in gdb?

假如想象 提交于 2019-12-11 02:29:57
问题 I am trying to debug my program using NSZombie. The debugger did return me the address of the instance with the issue, however I am not sure where to obtain the pid which is required to run the command 'shell malloc_history Can anyone advise me on what is the correct pid to use in this case? I tried 3298 and 3298:707 and they both didnt work. Appreciate any help here. Zhen Hoe 2011-05-19 16:57:05.779 CarParkDemon[3298:707] in table view cellforRow Method3 2011-05-19 16:57:05.781 CarParkDemon

Is it possible to use NSZombieEnabled in Monotouch?

旧城冷巷雨未停 提交于 2019-12-11 01:28:26
问题 I've been reading up about the environmental variable NSZombieEnabled and I wondered whether it is currently possible to use this in a Monotouch runtime? If not, is there a suitable alternative that I'm just glazing over? The reason I ask is because it may be helpful to find any leaks one may have in their app - I've tried to use Instruments with limited success and would like to try every possible option to ensure I have a nice and stable app. Edit I misunderstood what they were used for (it

Strange “zombie” in forwardInvocation: + getArgument:atIndex methods

自闭症网瘾萝莉.ら 提交于 2019-12-10 22:09:59
问题 Here is part from my code: - (void)viewDidLoad { [super viewDidLoad]; CGRect frame = [[UIScreen mainScreen] bounds]; _webView = [[UIWebView alloc] initWithFrame:frame]; [_webView setHidden:NO]; [self.view addSubview:_webView]; _vk = [[DPVkontakteCommunicator alloc] initWithWebView:_webView]; DPVkontakteUserAccount *user; NSString *accessToken = [[NSUserDefaults standardUserDefaults] objectForKey:@"accessToken"]; NSInteger userId = [[[NSUserDefaults standardUserDefaults] objectForKey:@"userId"

How to demonstrate memory leak and zombie objects in Xcode Instruments?

天大地大妈咪最大 提交于 2019-12-09 04:32:28
I would like to demonstrate memory leak and zombie object in Xcode Instruments on a class. I've found it pretty hard to trigger on purpose, especially with ARC turned on. Do you know how could I create them? bbum For A leak: Create two classes, A and B. A should have an @property that strongly references an instance of B. B should have an @property that strongly references an instance of A. A *a = [A new]; B *b = [B new]; a.b = b; b.a = a; That'll create a leak. For a Zombie Create a @property that is of type assign (or a variable of type __unsafe_unretained . Then: A *a = [A new]; A