Weird error message in Xcode 4.3 with LLDB

I am currently writing an iOS application with Xcode 4.3.2. In most parts of my code, debugging with LLDB works very well. However, at some point I get a strange message when I go through my code. When I hang over iVar, he says

Error [IRForTarget]: Unable to find Objective-C indirect symbol ivar OBJC_IVAR _ $ _ MyFancyClass.iVar

instead of showing me the meaning. However, in Variables View , I see it just fine. Until I select Print Description of ... because then Xcode crashes ... When I use GDB, the hang hangs, but the type and values โ€‹โ€‹of the variable are wrong.

I understand that something is wrong with my code, which in turn causes the debuggers to fail. However, the code is working fine. I would like to provide some sample code, but the class is quite long, and I cannot pinpoint the exact location of my debauchery. So has anyone encountered similar behavior?

UPDATE: Actually, it looks like this happens everywhere in my code, and not just in some specific files. If that helps, while LLDB shows the above message, GDB always shows the class object that owns iVar, not iVar itself. There seems to be something wrong with memory management. For example, if I say something like

 [notificationCenter addObserver:self selector:@selector(foo) name:bar object:objA]; 

the selector is called even if I have

 [notificationCenter postNotificationName:bar object:objB]; 
+6
source share
3 answers

The reason for this error is incorrect assembly settings, as evidenced by the discussion in the comments to the post message. This can be fixed by setting Postprocess Deployment back to NO for debug mode (default value).

+9
source

Make sure MyFancyClass.m added to your target.

+2
source

Your selector to which nsnotification is sent must have one (and only one) argument, which is NSNotification. Therefore, when you do this:

 [notificationCenter addObserver:self selector:@selector(foo) name:bar object:objA]; -(void)foo { } 

... you need to do this: [notificationCenter addObserver: self selector: @selector (foo :) name: bar object: objA];

 -(void)foo:(NSNotification *)notification { } 

Notice the colon in the selector for the notification center and the argument for foo.

0
source

Source: https://habr.com/ru/post/912258/


All Articles