Skip navigation.
 
mlRe: NSTableView, NSArrayController, NSManagedObjectContext
FROM : I. Savant
DATE : Tue Jan 01 20:28:43 2008

On Jan 1, 2008, at 2:22 PM, Ture Pålsson wrote:

> Now I suddenly need do call methods in an NSController, meaning that 
> I need
> to have a reference (probably in the form of an IBOutlet) to this
> controller somewhere. This is what put me off a bit.


  Bindings and Core Data don't do everything for you. :-) Just a few 
days ago, mmalc (quite correctly) said, "sometimes you just need to 
write some code".

  In this case, you're doing something outside your array 
controller's purview, so you need to tell it to -fetch: which means 
sending it a message. This in turn means (in your situation) an outlet 
to the array controller in your nib. This is perfectly normal (in 
fact, it's damned near impossible to avoid :-D).

  Take-home message: Don't feel you're doing something 'wrong' or 
'dirty' ... you're on the right track with an outlet.

--
I.S.