Search code examples
cocoansarraycontroller

How to programmatically setObjectClass for NSArrayController


I'm having a problem with what should be a very simple thing. I want to create an NSArrayController and specify the class it manages. Problem is, I can't figure out the correct way to specify the Class in the setObjectClass method. I want to do the following:

[projectArrayController setObjectClass:SKHProject];

SKHProject is a class that I've imported in the implementation file. I keep getting the "Expected expression before 'SKHProject'" error, but I can't figure out the correct expression. Where am I going wrong?


Solution

  • Do

    [projectArrayController setObjectClass:[SKHProject class]];
    

    !