New to Xcode, small problem

Discussion in 'Mac Programming' started by JimmyFeatures, Oct 31, 2005.

  1. JimmyFeatures macrumors newbie

    Oct 31, 2005
    I've just started using Xcode, after spending quite sometime using C/C++, and I have a small problem. I have a small program where the user must input text in to a text field, and I want to assign that string to a variable. I have all the outlets and actions set up, I just need to know the syntax of the code.

    For example, the outlet that the text field is connected to is called 'input' and I wish to assign that to the variable 'name'.

  2. cbiffle macrumors member

    Jun 19, 2005
    Tempe, AZ
    NSString *name = [input stringValue]; ?

    I include the question mark because you didn't specify what language you were writing in (C, Objective-C, C++), what libraries you were using (Carbon, Cocoa, or Java), etc.

    If you're using ObjC and Cocoa (which is what I'd recommend), I'd bookmark Apple's docs on the Application Kit and Foundation Kit. You can find most of this information there, or in the tutorials/howtos they link to.
  3. JimmyFeatures thread starter macrumors newbie

    Oct 31, 2005
    Thanks, that completely sorted me out.

    And yes, I'm using objective C and cocoa.

Share This Page