• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Using my framework source code for GUI application ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using my framework source code for GUI application ?


  • Subject: Using my framework source code for GUI application ?
  • From: Kubernan from 10191 Technologies <email@hidden>
  • Date: Sun, 3 Jul 2005 13:46:52 +0200

Hello,

My problem is about to find the best way for creating a GUI application
from source code used for building a cocoa framework.
The idea is to build a framework (that could be used by developers) and
a GUI application for end users in the way i didn't have to maintain
two too much different source code.

For example : my existing framework holds it's own
data model which is similar to a table view :

- There is a column class which describes the header and
the type of cells (i.e. Date, String, Numeric and so on ..).

- There is a row class which contains values (1 to n).
Note there is no direct link between the column and the row.

- There is a table class which contains several rows and several
columns. The table manages the coherence between columns
and rows and the save and load data from files. The table structure
is dynamic  (i.e. number of columns) and depends on the loaded file.

Other classes of my framework contain code that works
on this data model.

My first try for building my GUI was to display the
data model in a NSTableView using binding. I had to resolve
this problem : I can't used graphical binding (i.e. the columns of the NSTableView)
because my data model depends on the loaded file. Because the NSTableView structure
depends on this data model, the NSTableView in Interface Builder contains 0 column.


--> I had to modify my table class source code and create programatically
the columns for the NSTableView.
--> Then I had,of course, to programatically create bindings. It appears
the way the value of each row is stored is not appropriate for binding :
my row class uses NSMutableArray for storing these values.


To successfully bind the rows with the NSTableView column i had to use NSMutableDictionary
- where keys are columns' name - instead of NSMutableArray for storing values of a row.
This is the main problem : doing that i have to rewrite my 160 source code files where
my row class is used. It's not an elegant solution because because i have to adapt
my data model for the view.


As you could notice, i'm newbie in bindings, may be there is a better way
for solving my problem (may be subclassing a controller ?)


    What are your opinions and ideas about that ?

Thanks for your help,
K.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Prev by Date: Re: Application quits Unexpectedly
  • Next by Date: Re: undo prepareWithInvocationTarget KVC
  • Previous by thread: Re: Application quits Unexpectedly
  • Next by thread: How to end table cell editing by keyboard (return/enter)?
  • Index(es):
    • Date
    • Thread