Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoa - Suggested techniques for debugging binding problems between Xcode and Interface Builder

I am working my way through the examples in Hillegass's book 'Cocoa programming for Mac OS-X'. There have been a couple of occasions when a sample application I have been working through starts up and I get a message such as :

2009-03-11 00:39:19.167 CarLot[7517:10b] Cannot create NSData from object <_NSControllerObjectProxy: 0x188bf0> of class _NSControllerObjectProxy

The only way I have found of solving an issue like this is to painstakingly go through all of the bindings and attributes in the interface builder to see where I have missed some configuration - which all takes time!

Is there any more efficient way to determine what the problem is from the error message? Are there any debugging techniques you can use to track down problems like these?

like image 716
Hugh Mullally Avatar asked Mar 16 '09 15:03

Hugh Mullally


2 Answers

There's a wonderful article on Apple's Dev Site on troubleshooting bindings.

https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/Troubleshooting.html

The key take-away? There's a setting called NSBindingDebugLogLevel that you can use to get debug information.

Two ways to set it:

1 - Permanently in your defaults

defaults write com.yourdomain.yourapplication NSBindingDebugLogLevel 1

2 - Pass it as a parameter when you debug

path/to/your/app -NSBindingDebugLogLevel 1

like image 177
Michael Bishop Avatar answered Sep 25 '22 01:09

Michael Bishop


This Article talks very briefly about this.

Basically, it states that you can look in the Xib files to figure out a bit more quickly what bindings you have set in your app.

Hope that helps!

like image 25
Aaron Avatar answered Sep 23 '22 01:09

Aaron