Text Array

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

  1. bguy macrumors newbie

    Joined:
    May 30, 2009
    #1
    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

    gnasher729

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

    Joined:
    Aug 9, 2009
    #3
    Post your code. We can't debug descriptions of malfunctioning code.
     
  4. bguy thread starter macrumors newbie

    Joined:
    May 30, 2009
    #4
    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

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

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

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #7
    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