Text Array

Discussion in 'Mac Programming' started by bguy, Aug 11, 2009.

  1. bguy macrumors newbie

    May 30, 2009
    I want to create a two dimensional array of textfields in order to allow them to "understand" their relationship with one another. My first thought was to have a method that would take two inputs and return the correct textfield, but it doesn't allow textfields to be used as a method type. How can I do this?
  2. gnasher729 macrumors P6


    Nov 25, 2005
    You do know the difference between say "NSTextField" and "NSTextField *" ?
  3. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    Post your code. We can't debug descriptions of malfunctioning code.
  4. bguy thread starter macrumors newbie

    May 30, 2009
    AI Coding Help

    I solved it, I accidently had a constant where a variable should have been. It works well now.
  5. ChOas macrumors regular

    Nov 24, 2006
    The Netherlands
    No offense meant, whatsoever, but do you know the concept of loops ?
  6. bguy thread starter macrumors newbie

    May 30, 2009
    Yes I do, but I wanted it expressed in this way.
  7. HiRez macrumors 603


    Jan 6, 2004
    Western US
    One way is to assign values to the tag attribute (an int) on your text fields. Then you can pass around an int variable if you want (and use it in switch statements).

    Also, by convention in Objective-C, method and variable names begin with a lowercase letter. An uppercase name typically denotes a class. It's not incorrect (won't result in an error), but it'll look odd to an Obj-C programmer trying to read it.

Share This Page