Search Fields, Array Controllers and Multiple NIBs
Search Fields, Array Controllers and Multiple NIBs
- Subject: Search Fields, Array Controllers and Multiple NIBs
- From: Brad Gibbs <email@hidden>
- Date: Mon, 19 Jan 2009 20:58:56 -0800
I'm having a fundamental disagreement with Cocoa and I'm really hoping
someone can help me see it her way...
I have a Core Data app with a container view controller and multiple
subviews, each with a view controller and a separate NIB. Subview
switching is done via a segmented control. The subviews each display
the same data, but in different ways -- one is a table view, another
is an image view and the third is a cover flow view.
The container view displays the segmented control that does the
switching and a search field that is used to filter what is shown in
the subviews. My aim is to have the search field filter the three
views equally, such that if the user performs a search, all three
subviews will show the filtered results of that search. So, the user
the perform the search and each of the three views will display the
filtered results of the same search.
I've tried a number of approaches. To me, it seems the most logical
approach is to have the container view pass its MOC and
NSArrayController instance to each of the subviews as it creates
them. I still need to create an NSArrayController instance in each
view's NIB file in IB to bind the objects in each of the views, but I
can create an outlet in each view controller and set it to the
NSArrayController instance passed in from the main view when the
subview is instantiated. But, this doesn't seem to work. I can NSLog
each array controller to see that each view has the same instance of
the NSArrayController, but searching in the main view doesn't seem to
filter any of the subviews properly.
I'm sure I haven't described the issues clearly but I'm hoping someone
will understand this well enough to propose a solution.
Thanks in advance,
Brad
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden