|
|
Sample Programs from NeXSTEP 3.3
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f2\fnil Times-Roman;\f1\fmodern Ohlfs;}
\paperw13700
\paperh11400
\margl120
\margr120
{\colortbl;\red0\green0\blue0;}
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b\i0\ulnone\fs36\fc0\cf0 TableViewExample
\b0\fs24 \
by Mai Nguyen, NeXT Developer Support Team\
\
\b\fs28 Overview
\b0\fs24 \
\
In order to run this example, you need to have a Sybase server with a pubs database installed. This example uses the
\b SybaseDemo.dbmodela
\b0 model file (also available under /NextDeveloper/Examples/DatabaseKit/Models).\
\i For Oracle users, you can modify the TableViewController.m file to comment out #define SYBASE_DEMO and recompile the application.\
\
\i0 This example shows how you can define a DBTableView and a DBModule programmatically instead of using the corresponding Interface Builder UI Objects .
\fc1\cf1 It also shows how you can change the sort order every time the columns in the tableview are rearranged. The sort property is determined by the identifiers of the tableview columns.\
\fc0\cf0 \
\b\fs28\fc1\cf1 Program Organization
\b0\fs24 \
\
\b Major Classes in the Application
\b0 \
\
\
\pard\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fi-1900\li1900\fc1\cf1 TableViewController A general manager object. A subclass of the Object class. Performs miscellaneous initialzations for the DBModule and DBTableView objects. \
\pard\tx560\tx1120\tx2060\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\fi-2060\li2060\fc1\cf1 \
\
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fc1\cf1 Other Peculiarities
\b0 \
In order to load an Adaptor dynamically, you need to add the
\b OTHER_LDFLAGS
\b0 definition (see the
\b Makefile.preamble
\b0 ). You also need to add the
\b libdbkit_s.a
\b0 library into your
\b PB.project
\b0 under
\b libraries
\b0 in order to use the DBKit API. \
\
\b\fs28 Topics Of Interest
\b0\fs24 \
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\b\fc1\cf1 \
- How to get all the attributes from an entity and the sub-attributes that belongs to a one-to-one relationship of\
that same entity
\b0 \
See the method
\b initTableView:
\b0 in the file TableViewController.m.\
\f2\fs28 \
\f0\b\fs24 - How to make a fetchgroup become the datasource of the tableview by using the method \
makeAssociationFrom:
\b0 \
See the method
\b initTableView:
\b0 in the file TableViewController.m\
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc1\cf1 \
-
\b How to replicate the IB connections to a tableview by using DBExpressions\
\b0 See the method
\b addTableColumn
\b0 in the file TableViewController.m\
\
\
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\b\fs28\fc1\cf1 Change History
\b0\fs24 \
February 1993 Updated for 3.1
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.