ArrayController in non-document based Applications
I just tried to use the ArrayController in an app. The app was not document based. I did everything as you are supposed to do, I made up a class called AppControll, set it Files Owner of the XIB file, connected the contend Array and so on. There were no warnings or errors, the compiler said No Issues, the Build was suchsessfull. But before the window has opened, the Application crashed. On the console was this log:
2011-05-17 16:28:45.652 MyApp[9637:903] An uncaught exception was raised
2011-05-17 16:28:45.656 MyApp[9637:903] [<NSApplication 0x10011b240> valueForUndefinedKey:]: this class is not key value coding-compliant for the key boxArray.
2011-05-17 16:28:45.792 MyApp[9637:903] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSApplication 0x10011b240> valueForUndefinedKey:]: this class is not key value coding-compliant for the key boxArray.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00007fff8059a7b4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x00007fff864c30f3 objc_exception_throw + 45
2 CoreFoundation 0x00007fff805f2969 -[NSException raise] + 9
3 Foundation 0x00007fff867abb8e -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 245
4 Foundation 0x00007fff866db488 -[NSObject(NSKeyValueCoding) valueForKey:] + 420
5 AppKit 0x00007fff8810a384 -[NSApplication(NSScripting) valueForKey:] + 492
6 Foundation 0x00007fff866dedcc -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 226
7 AppKit 0x00007fff87e9fb6f -[NSBinder valueForBinding:resolveMarkersToPlaceholders:] + 171
8 AppKit 0x00007fff88065f80 -[NSArrayDetailBinder _refreshDetailContentInBackground:] + 368
9 AppKit 0x00007fff87e92a33 -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 557
10 AppKit 0x00007fff87e6f546 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1172
11 AppKit 0x00007fff87e6d88d loadNib + 226
12 AppKit 0x00007fff87e6cd9a +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 248
13 AppKit 0x00007fff87e6cbd2 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 326
14 AppKit 0x00007fff87e6a153 NSApplicationMain + 279
15 MyApp 0x0000000100001302 main + 34
16 MyApp 0x00000001000012d4 start + 52
)
terminate called after throwing an instance of 'NSException'
The debugger tells me "Programm recieved signal SIGBART"
If I cut the bnding to the contend array, the Applications stats as usual, but it dosent work, because there is no contend array.
Then I tried something else. I made up a new project, this time a document-based one, and did exactly the same as I did before. It worked well and fine the way it should work. There was no problem and the ArrayController worked fine. I don`t think a made mistake writing the name of the array, because I allways copied and pasted the name to the IB. So I would like to know if it is possible to use an ArrayController in a Non-document based Application? What do i have to do differently? The reference about the ArrayController does not mention this. It would be great if you could help me soon, thank you.
Xcode 4-OTHER