Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lldb strange error

Tags:

I am using xCode 4.3.1 and as soon I want to use lldb, I hardly get any debug information but get the following result instead, po-ing on a simple NSMutableDictionary property:

(lldb) po _keywordCache
error: instance method 'delegate' has incompatible result types in different translation units ('objc_object *' vs. 'id')
error: instance method 'delegate' has incompatible result types in different translation units ('objc_object *' vs. 'id')
note: instance method 'delegate' also declared here
note: declared here with type 'id'
note: instance method 'delegate' also declared here
note: declared here with type 'id'
error: 2 errors parsing expression

Switching to gdb always gives proper results.
Anyone an idea?

like image 430
Koen Avatar asked Apr 16 '12 08:04

Koen


2 Answers

The source of the problem in my case was that the property in question here, "delegate" is declared as a subtly different type in the instance variable and the property declaration. In my case, the instance variable type was id and the property declaration was id<SomeProtocol>.

I'm going to report this as a bug to Apple, as it shouldn't cause failure to inspect variables. The fix is to make sure that the instance variable and the property declaration describe "delegate" as exactly the same type. Hope this helps!

like image 114
danielpunkass Avatar answered Oct 12 '22 09:10

danielpunkass


I know this is late, but ran into this on Xcode 6, needed to do a Clean Build Folder (hold down option while selecting clean).

like image 39
migs647 Avatar answered Oct 12 '22 10:10

migs647