• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Objective C array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective C array


  • Subject: Re: Objective C array
  • From: Carl Jochen Norum <email@hidden>
  • Date: Fri, 31 May 2002 14:49:42 -0600

Quoting Eric Conrad <email@hidden>:
> The fields with the arrows pointed to them are my question, in my app I
> have 10 fields for class credits and class grades each numbered 1-10. so
> for example classCredit1 and classGrade1. Now how can I, in the for
> loop, use the current number (i) the for loop and append it onto the end
> of classGrade and classCredit.

If you have multiple related fields like this, you should use an NSForm
instead of a bunch of NSTextFields. Then you can say something like:

for(i=0; i<10; i++) {
classCredits[i] = [[classCreditForm cellAtIndex:i] floatValue];
classGrades[i] = [[classGradeFrom cellAtIndex:i] floatValue];
}

Which is much tighter code and will make you happier in the long run.

--
Carl J Norum
4th Year Electrical Engineering/Computer Science Student
University of Saskatchewan
Saskatoon, Canada
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Objective C array (From: Eric Conrad <email@hidden>)

  • Prev by Date: Re: Getting font info
  • Next by Date: Re: Getting font info
  • Previous by thread: Objective C array
  • Next by thread: Re: Objective C array
  • Index(es):
    • Date
    • Thread