Execption: class is not kvc-compliant for key stretchView


#1

Hi!

I am at page 265 (composite an image onto your view) and I every time i try to build and run the app I get an error message (see below). I already double checked the code and it seems to be alright. May someone please help me and tell me what I might look at to solve the problem?

2012-04-10 20:14:05.575 DrawingFun[489:403] An uncaught exception was raised 2012-04-10 20:14:05.580 DrawingFun[489:403] [<NSUserDefaultsController 0x7fde7192fc50> valueForUndefinedKey:]: this class is not key value coding-compliant for the key stretchView. 2012-04-10 20:14:05.591 DrawingFun[489:403] ( 0 CoreFoundation 0x00007fff92658fc6 __exceptionPreprocess + 198 1 libobjc.A.dylib 0x00007fff8f8efd5e objc_exception_throw + 43 2 CoreFoundation 0x00007fff926e32a9 -[NSException raise] + 9 3 Foundation 0x00007fff96f766f3 -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 240 4 Foundation 0x00007fff96ead3b2 _NSGetUsingKeyValueGetter + 108 5 Foundation 0x00007fff96ead339 -[NSObject(NSKeyValueCoding) valueForKey:] + 392 6 Foundation 0x00007fff96eccdc6 -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 348 7 AppKit 0x00007fff92a19ae2 -[NSBinder _valueForKeyPath:ofObject:mode:raisesForNotApplicableKeys:] + 654 8 AppKit 0x00007fff92a197cc -[NSBinder valueForBinding:resolveMarkersToPlaceholders:] + 171 9 AppKit 0x00007fff92c1d07e -[NSValueBinder _referenceBindingValue] + 31 10 AppKit 0x00007fff92c1ce8f -[NSValueBinder _adjustObject:mode:observedController:observedKeyPath:context:editableState:adjustState:] + 647 11 AppKit 0x00007fff92c1cb74 -[NSValueBinder _observeValueForKeyPath:ofObject:context:] + 303 12 AppKit 0x00007fff92a0b777 -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 591 13 AppKit 0x00007fff92a04a89 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1079 14 AppKit 0x00007fff929fb09f loadNib + 322 15 AppKit 0x00007fff929fa59c +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 217 16 AppKit 0x00007fff929fa4b7 +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 141 17 AppKit 0x00007fff929fa3fa +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 364 18 AppKit 0x00007fff92c6d9b3 NSApplicationMain + 398 19 DrawingFun 0x00000001006dba82 main + 34 20 DrawingFun 0x00000001006dba54 start + 52 21 ??? 0x0000000000000003 0x0 + 3 ) 2012-04-10 20:14:05.749 DrawingFun[489:403] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSUserDefaultsController 0x7fde7192fc50> valueForUndefinedKey:]: this class is not key value coding-compliant for the key stretchView.' *** First throw call stack: ( 0 CoreFoundation 0x00007fff92658fc6 __exceptionPreprocess + 198 1 libobjc.A.dylib 0x00007fff8f8efd5e objc_exception_throw + 43 2 CoreFoundation 0x00007fff926e32a9 -[NSException raise] + 9 3 Foundation 0x00007fff96f766f3 -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 240 4 Foundation 0x00007fff96ead3b2 _NSGetUsingKeyValueGetter + 108 5 Foundation 0x00007fff96ead339 -[NSObject(NSKeyValueCoding) valueForKey:] + 392 6 Foundation 0x00007fff96eccdc6 -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 348 7 AppKit 0x00007fff92a19ae2 -[NSBinder _valueForKeyPath:ofObject:mode:raisesForNotApplicableKeys:] + 654 8 AppKit 0x00007fff92a197cc -[NSBinder valueForBinding:resolveMarkersToPlaceholders:] + 171 9 AppKit 0x00007fff92c1d07e -[NSValueBinder _referenceBindingValue] + 31 10 AppKit 0x00007fff92c1ce8f -[NSValueBinder _adjustObject:mode:observedController:observedKeyPath:context:editableState:adjustState:] + 647 11 AppKit 0x00007fff92c1cb74 -[NSValueBinder _observeValueForKeyPath:ofObject:context:] + 303 12 AppKit 0x00007fff92a0b777 -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 591 13 AppKit 0x00007fff92a04a89 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1079 14 AppKit 0x00007fff929fb09f loadNib + 322 15 AppKit 0x00007fff929fa59c +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 217 16 AppKit 0x00007fff929fa4b7 +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 141 17 AppKit 0x00007fff929fa3fa +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 364 18 AppKit 0x00007fff92c6d9b3 NSApplicationMain + 398 19 DrawingFun 0x00000001006dba82 main + 34 20 DrawingFun 0x00000001006dba54 start + 52 21 ??? 0x0000000000000003 0x0 + 3 ) terminate called throwing an exception(lldb)


#2

I’ve got exactly the same issue and am kinda stuck :frowning:


#3

I forgot to use:

[self …] when referring to a property rather than addressing it by purely it’s name :smiley: