> On May 12, 2015, at 1:01 AM, Pelle Krøgholt <[email protected]> wrote:
> 
> Now when I try to look up the properties of `views` then I keep getting:
> 
>     MyIOSAPP[26894:207053] -[__NSCFDictionary propertyForKey:]: unrecognized 
> selector sent to instance 0x7fcc99e9a7e0

Well, that error means exactly what it says: ‘views’ is an NSDictionary, and 
you’re trying to call -propertyForKey: on it, which isn’t an NSDictionary 
method. It sounds like you’re expecting that ‘views’ is a CBLDocument, but that 
doesn’t make sense — documents don’t contain documents.

Couchbase Lite documents are JSON objects. CBLDocument.properties returns that 
JSON object parsed into Cocoa objects of class NSDictionary, NSArray, NSString, 
NSNumber, or NSNull. Same goes for -propertyForKey:.

A hint for future debugging: when you’re curious what the value or class of a 
variable is at runtime, set a breakpoint there, then look at the value in the 
debugger. If the variable list doesn’t tell you, you can print an object using 
the ‘po’ command. If you want to know what its exact class is, try ‘po [views 
class]’.

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/2EA6BB4E-0FE4-4CDA-BDE6-D9F3707B967F%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to