Core data design related question
Core data design related question
- Subject: Core data design related question
- From: Marc Rink <email@hidden>
- Date: Tue, 20 Oct 2009 22:11:22 +0200
Heyas,
I am quite new to Objective-C (and to some extend to OO concepts as
well), so please be gentle with me :)
I have a core data based document application that purpose is to
access a mysql database (i am using the MCP Kit).
The documents in my context are Views that contain different aspects
of the database (small portions consisting of some tables related to
each other).
One document contains the connection parameters for the database.
I am switching the views according to Aaron Hillegass' example using a
view controller (the downloadable examples are http://www.bignerdranch.com/solutions/Cocoa-3rd.tgz)
.
I want to achive the following:
Upon application start the first view "ConfigViewController" is shown.
It contains all connection related parameters (such as host, port,
user, password and database) and a "Connect" button.
Upon clicking the "Connect" button, the connection to the database is
established. The result is a connection object, that i wanted to pass
around the different Views.
First approach was to pass the resulting connection to the superclass
of the view's (all my view's are derived from a custom superclass
which extends NSViewController). For reasons i dont know, i didnt get
this to work. The resulting object was invalid (nil) in the other
view's.
Second approch (and better one imho) is to add a core data entity
"DBConfiguration" holding all connection parameters (persistent, so
you dont have to enter the stuff every time) and a transient property
for the connection object (of type undefined).
I added a Object Controller to my documents xib file, set the mode to
"Entity" and the entity name to "DBConfiguration".
My Problem now is: The view containing the textfields and the
"connect" button are in a different xib file (ConfigView.xib, whose
Files Owner is of Type "ConfigViewController". I dont know how to bind
the ConfigView's text fields to the Object Controller in MyDocument.xib.
I am still new to the different frameworks and unsure about whether my
design is acceptable or if i am on a completely wrong way.
Any help would be appriciated!
Thanks
Marc
_______________________________________________
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