Getting the carArrayController to work


#1

Maybe this has been posted in one of the threads, but I can’t find it.
I couldn’t get the carArrayController to display the current date when a new Car is added. After adding the newObject function and changing the arrayController to the new class…nothing happened.
The solution I use is to add the function call to the carArrayController.h file (eg add the line -(id)newObject; in carArrayController.h).
Hopefully this helps someone out.
Cheers,
Erik


#2

I have the same problem - CarArrayController does not seem to work - and adding the method declaration in CarArrayController.h had no effect. I put an NSLog(…) message into newObject and it does not log anything, so newObject from CarArrayController is not getting called. Any suggestions are welcome. My environment: MacOS 10.7.5 (Lion) and Xcode 4.6.2.


#3

I had the same problem. I had to override another method (one declared in NSArrayController rather than NSObjectController). I chose add: and simply called the super add:. After I got it to work, I took the definition for add: out and it continues to work. Suspect that XCode is attempting to optimize by not replacing NSArrayController with CarController unless it is certain that there is some reason to do so.