Re: Objective C array
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.