How do you found your way around in the ref docs?

  • A question from a newbie. I tried to create a simple application with one
    text field and one button. I opened NSTextField Class Reference and looked
    for a getter method in order to get the text that the user has entered in
    the text field. Looked through all the document, which took quite a while,
    but found nothing. Then I looked in the superclass NSControl Class
    Reference. Looked in Methods by Task but didn't find anything to begin with,
    but after a while found the getter method stringValue under the heading of
    "Setting the control's value".

    My question is if there is some logic to

    1. Storing the getter of a text field in NSControl instead of NSTextField
    2. Storing a getter method under the heading "Setting the control's value"
    (instead of something like "Setting/Getting the control's value").

    Thanks
    Frank
  • When in doubt, I try to type in some method name so that auto-
    complete can suggest me methods accessible for the object I'm using.
    So by typing "[yourinstancename str" in your code and then hitting
    ESC (when "str" gets underlined this means auto-complete has
    suggestions available) a menu appear where you can search the method
    in there. You just have to guess what would be the function name...

    Luc

    On 25-Aug-07, at 12:37 PM, Frank Bettger wrote:

    > A question from a newbie. I tried to create a simple application
    > with one
    > text field and one button. I opened NSTextField Class Reference and
    > looked
    > for a getter method in order to get the text that the user has
    > entered in
    > the text field. Looked through all the document, which took quite a
    > while,
    > but found nothing. Then I looked in the superclass NSControl Class
    > Reference. Looked in Methods by Task but didn't find anything to
    > begin with,
    > but after a while found the getter method stringValue under the
    > heading of
    > "Setting the control's value".
    >
    > My question is if there is some logic to
    >
    > 1. Storing the getter of a text field in NSControl instead of
    > NSTextField
    > 2. Storing a getter method under the heading "Setting the control's
    > value"
    > (instead of something like "Setting/Getting the control's value").
    >
    > Thanks
    > Frank
    >
  • Am 25.08.2007 um 18:37 Uhr schrieb Frank Bettger:

    > My question is if there is some logic to
    >
    > 1. Storing the getter of a text field in NSControl instead of
    > NSTextField

    stringValue is not only useful for NSTextField, but also for buttons
    and other controls. So, yes, it is logical to have it available in
    NSControl.

    > 2. Storing a getter method under the heading "Setting the control's
    > value"
    > (instead of something like "Setting/Getting the control's value").

    Setters and getters are always grouped together, I think. Not that
    difficult a concept to remember. In case you still feel, that using
    "Setting/Getting" instead of just "Setting" would be better, there's
    a feedback form on each page of the online documentation.

    Apart from that, I still recommend AppKiDo for browsing the class
    hierarchy:

    http://homepage.mac.com/aglee/downloads/

    Andreas
  • Tkanks Luc,

    I was not aware of Xcode completion since I've used TextMate. It's nice and
    useful! However when I tried with my example, se below it just said no
    completions found

    NSTextField *text1;
    NSString *inString;
    inString=[text1 stringV

    On 8/25/07, Luc Vandal <lvandal...> wrote:
    >
    > When in doubt, I try to type in some method name so that auto-
    > complete can suggest me methods accessible for the object I'm using.
    > So by typing "[yourinstancename str" in your code and then hitting
    > ESC (when "str" gets underlined this means auto-complete has
    > suggestions available) a menu appear where you can search the method
    > in there. You just have to guess what would be the function name...
    >
    > Luc
    >
    >
    >
    >
  • Thanks Sam,

    Appkido is very nice, giving a better overview of refdocs then Xcode does.
    However it does not add any intelligence, but just takes the underlying doc
    structure as is. So in my example it would be of little help. Is there any
    web site that describes how to find your way around in refdocs and how it is
    structured?

    Frank

    On 8/25/07, Sam DeVore <sdevore...> wrote:
    >
    > On Aug 25, 2007, at 9:37 AM, Frank Bettger wrote:
    >
    > A question from a newbie. I tried to create a simple application with one
    >
    > text field and one button. I opened NSTextField Class Reference and looked
    >
    > for a getter method in order to get the text that the user has entered in
    >
    > the text field. Looked through all the document, which took quite a while,
    >
    > but found nothing. Then I looked in the superclass NSControl Class
    >
    > Reference. Looked in Methods by Task but didn't find anything to begin
    > with,
    >
    > but after a while found the getter method stringValue under the heading of
    >
    > "Setting the control's value".
    >
    >
    > there are also some other great tools for digging in the documentation
    >
    > http://homepage.mac.com/aglee/downloads/appkido.html
    >
    > and
    >
    > http://homepage2.nifty.com/hoshi-takanori/cocoa-browser/
    >
    > sometimes they just click better for me, I tend to refer to appkido more
    > then the built in docs
    >
    > Sam D
    >
    >
    >
  • Hi Frank,

    You may refer to these documents for more info on xcode completition:

    http://developer.apple.com/DOCUMENTATION/DeveloperTools/Conceptual/
    XcodeUserGuide/Contents/Resources/en.lproj/03_05_ed_code_completion/
    chapter_22_section_2.html

    http://developer.apple.com/documentation/developertools/Conceptual/
    XcodeUserGuide/Contents/Resources/en.lproj/03_05_ed_code_completion/
    chapter_22_section_3.html

    Luc

    On 25-Aug-07, at 2:41 PM, Frank Bettger wrote:

    > Tkanks Luc,
    >
    > I was not aware of Xcode completion since I've used TextMate. It's
    > nice and
    > useful! However when I tried with my example, se below it just said no
    > completions found
    >
    > NSTextField *text1;
    > NSString *inString;
    > inString=[text1 stringV
    >
    > On 8/25/07, Luc Vandal <lvandal...> wrote:
    >>
    >> When in doubt, I try to type in some method name so that auto-
    >> complete can suggest me methods accessible for the object I'm using.
    >> So by typing "[yourinstancename str" in your code and then hitting
    >> ESC (when "str" gets underlined this means auto-complete has
    >> suggestions available) a menu appear where you can search the method
    >> in there. You just have to guess what would be the function name...
    >>
    >> Luc
    >>
    >>
    >>
    >>


    Software
    & Web Apps
    Luc Vandal
    Edovia Inc.
    Montreal
    514.377.8111
    <lvandal...>
    www.edovia.com
  • FROM : Andreas Mayer wrote

    > stringValue is not only useful for NSTextField, but also for buttons
    > and other controls. So, yes, it is logical to have it available in
    NSControl.

    Thanks Andreas, that is a logical

    > Setters and getters are always grouped together, I think. Not that
    > difficult a concept to remember.

    It's not once you've seen it, but if you've never seen it before it is kind
    of strange. However no big deal.

    Thanks for your help
  • hi Frank,

    the way i usually work through the classes is by typing (into an
    Xcode editor) the name of the class (in your case NSTextField) then i
    cmd-doubleclick the name and it opens the class' header file. then i
    cmd-f to search for something that might sound usefull, like "string"
    in your case...this will find return values as well as parts of the
    selector (keep in mind that cmd-g will speed up the search). If i
    don't find anything i just cmd-doubleclick the superclass that is
    written in the class-declaration and repeat there.... if i don't find
    anything i try the Xcode documentation (option-click some class or
    selector) and search using full-text search. the last alternative is
    the net ;-)

    Kind Regards
    Karsten

    Am 25.08.2007 um 20:57 schrieb Frank Bettger:

    > FROM : Andreas Mayer wrote
    >
    >> stringValue is not only useful for NSTextField, but also for buttons
    >> and other controls. So, yes, it is logical to have it available in
    > NSControl.
    >
    > Thanks Andreas, that is a logical
    >
    >> Setters and getters are always grouped together, I think. Not that
    >> difficult a concept to remember.
    >
    > It's not once you've seen it, but if you've never seen it before it
    > is kind
    > of strange. However no big deal.
    >
    > Thanks for your help
    >
    >
  • Thanks Karsten
    Your advice was very helpful :). I did as you suggested
    1. Cmd+double-clicked NSTextField
    2. Cmd+F "string", Ignore Case, Wrap Around. Found three irrelevant matches.
    3. Scrolled up to #import <AppKit/NSControl.h> and double-clicked NSControl
    4. Cmd+F "string" again. Found the promissing match - (NSString
    *)stringValue;
    5. Went to Help->Documentation. Entered stringValue and performed API
    search. Found 7 matches.
    6. Chose the NSControl match and found

    stringValue
    Returns the value of the receiver's cell as an NSString object.
    - (NSString *)stringValue

    Became curious of what a "cell" is? I thought that a cell is something like
    a text field or a button, but could it be anything else? Tried to look it up
    but after a long wandering about refdocs found nothing. Now the concept of
    "cell" must mean something specific and I thought that it would be decent of
    apple to define new concepts they introduce. But where do you find such
    definitions???

    Thanks Frank

    On 8/26/07, Karsten <karsten...> wrote:
    >
    > hi Frank,
    >
    > the way i usually work through the classes is by typing (into an
    > Xcode editor) the name of the class (in your case NSTextField) then i
    > cmd-doubleclick the name and it opens the class' header file. then i
    > cmd-f to search for something that might sound usefull, like "string"
    > in your case...this will find return values as well as parts of the
    > selector (keep in mind that cmd-g will speed up the search). If i
    > don't find anything i just cmd-doubleclick the superclass that is
    > written in the class-declaration and repeat there.... if i don't find
    > anything i try the Xcode documentation (option-click some class or
    > selector) and search using full-text search. the last alternative is
    > the net ;-)
    >
    > Kind Regards
    > Karsten
    >
  • Luckily for you, Apple is decent enough to define new concepts they
    introduce.

    http://developer.apple.com/documentation/Cocoa/Conceptual/ControlCell/
    index.html

    They link to this /everywhere/ and mention NSCell and its various
    subclasses in all of the applicable places. (The docs for NSButton,
    NSSlider, and so forth all mention this stuff.)

    I'm not sure how you missed any of this.

    --
    m-s

    On 26 Aug, 2007, at 14:53, Frank Bettger wrote:

    > Became curious of what a "cell" is? I thought that a cell is
    > something like
    > a text field or a button, but could it be anything else? Tried to
    > look it up
    > but after a long wandering about refdocs found nothing. Now the
    > concept of
    > "cell" must mean something specific and I thought that it would be
    > decent of
    > apple to define new concepts they introduce. But where do you find
    > such
    > definitions???
  • Thanks Michael for the link,

    Like I said in my first post I'm a newbie and it's not easy to find your way
    around a new town that you've never been in. Actually I did visit the page
    you mentioned "Introduction to Control and Cell Programming Topics for
    Cocoa" but had difficulty to determine what a cell is from that document. It
    says:

    "Controls and cells implement user-interface objects, like buttons, text
    fields, and sliders."

    What does that mean? Are buttons, fields and sliders the only cells there
    are, or are there others? Since they use the word "like" I think they mean
    the latter. So what are the other examples of cells?

    Further down they talk about "user interface objects" like Buttons, Image
    Views, Sliders, Text Fields, Boxes, Progress Indicators, ..., Search Fields
    and Segmented Controls. There are 18 "user interface objects" they mention.
    But which of these are "cells"? Or are all 18 of them cells?

    So I'm still not wiser about what a "cell" is?

    Thanks Frank

    On 8/26/07, Michael Watson <mikey-san...> wrote:
    >
    > Luckily for you, Apple is decent enough to define new concepts they
    > introduce.
    >
    > http://developer.apple.com/documentation/Cocoa/Conceptual/ControlCell/
    > index.html
    >
    > They link to this /everywhere/ and mention NSCell and its various
    > subclasses in all of the applicable places. (The docs for NSButton,
    > NSSlider, and so forth all mention this stuff.)
    >
    > I'm not sure how you missed any of this.
    >
  • On Aug 26, 2007, at 12:50 PM, Frank Bettger wrote:

    > So I'm still not wiser about what a "cell" is?

    The answer to that just takes a little more reading of the document
    you apparently skimmed.

    -Shawn
  • On Aug 26, 2007, at 12:50 PM, Frank Bettger wrote:

    > Like I said in my first post I'm a newbie and it's not easy to find
    > your way
    > around a new town that you've never been in.
    >
    When you go to the reference library's Cocoa section (<http://developer.apple.com/referencelibrary/Cocoa/index.html>), at the top left there's a link titled "Getting Started" ("A
    guided introduction and learning path for developers new to Cocoa.").
    That would be a good starting point... In particular, the "Getting
    Started" article mentions the "Cocoa Fundamentals Guide" (<http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals
    /index.html
    >) which offers "an orientation to Cocoa software development,
    including the basic concepts, terminology, design patterns, and
    architectures."

    mmalc
  • Thanks Shawn,

    First I didn't understand what you meant. But then I noticed a link "Next
    Page >" down in the right corner of the web page. So what I thought was a
    small document turned out to be a much larger document. (I also noticed in
    the upper left corner a link to the whole document in pdf format, which is
    better for me since I can handle the doc as a whole and also search within
    it :) ).

    On 8/27/07, Shawn Erickson <shawnce...> wrote:

    >
    > The answer to that just takes a little more reading
    >
  • This is very helpful :)
    Thanks Frank

    On 8/27/07, mmalc crawford <mmalc_lists...> wrote:
    >
    >
    >
    > In particular, the "Getting Started" article mentions the "Cocoa
    > Fundamentals Guide"
    > ...which offers "an orientation to Cocoa software development,
    > including the basic concepts, terminology, design patterns, and
    > architectures."
    >
    > mmalc
    >
    >
    >
previous month august 2007 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today