Changeset 7711

Nov 23, 2007, 2:12:58 AM (12 years ago)

added instructions for adding custom classes

2 added
1 edited


  • trunk/ccl/examples/cocoa/currency-converter/HOWTO_files/pages/building_ui.html

    r7709 r7711  
    2929  Objective-C, and does not use XCode project files, so you can skip
    3030  the part of the tutorial that explains how to use XCode.</p>
     32<div class="section-head">
     33  <h2>Using InterfaceBuilder to Create the UI</h2>
    3236      <p>We'll begin by using Apple's InterfaceBuilder application to
    117121  called <a href="">What's Next</a>,
    118122  you are done creating the interface for your
    119 application. Save your nibfile and continue with the next section of
    120 this HOWTO, on writing the Lisp code that provides the application's
    121 behavior.</p>
     123application. Save your nibfile and continue with the next section.</p>
     125<div class="section-head">
     126  <h2>Adding Custom Classes to the nibfile</h2>
     129<p>The user interface for your application looks right, but before it
     130  can work right, we have to record some more information  in the
     131  nibfile about the classes of the objects. In the following sections
     132  we'll see how to write the Lisp code that defines your
     133  application's classes. Before we're done with InteraceBuilder we
     134  need to put references to those classes in the nibfile, so that
     135  your application will create the correct objects when it
     136  launches.</p>
     138<p>As you will see in the following sections, we'll be using Lisp code
     139  to define two Objective C classes: Converter, and
     140  ConverterController. The Converter class implements the method that
     141  performs the actual currency conversion for our application; the
     142  ConverterController class provides communication between the user
     143  interface and the Converter object. We need a way to create instaces
     144  of these two classes in the nibfile, so that launching the
     145  application creates these instances and the connections between them
     146  and the rest of the user interface.</p>
     148<p>In InterfaceBuilder's Library window, select the Cocoa Objects and
     149  Controllers view:</p>
     151      <div class="inline-image">
     152        <img src="../images/ibwin-leopard3.jpg"alt=""
     153             border='0'/>
     154      </div>
     156<p>Drag an Object from the Library window and drop it into the main
     157  CurrencyConverter window:</p>
     159      <div class="inline-image">
     160        <img src="../images/ibwin-leopard4.jpg"alt=""
     161             border='0'/>
     162      </div>
     164<p>Now tell InterfaceBuilder the name of the new object's class. With
     165  the Object icon selected in the main CurrencyConverter window,
     166  choose the Identity tab of the Inspector:</p>
    123168    <div class="nav">
Note: See TracChangeset for help on using the changeset viewer.