• 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
Files and arrays
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Files and arrays


  • Subject: Files and arrays
  • From: Mike Brinkman <email@hidden>
  • Date: Thu, 14 Nov 2002 16:27:17 -0500

Sorry if this is a basic question, but I don't know where to even look for the answer. I'm sure I'll get the standard "RTFM", but I've checked out NSFileWrapper class, but didn't see the info I was looking for.

I want to create an array and initialize it with the contents of a comma separated text file. There are 10 records in the text file, and at the end of each record there is a return character (this file was created in TextEdit in OS X, so I'm not sure what the return character is).

I have a class Person and it's defined as:

@interface Person : NSObject {
NSString *personName;
NSString *personPic;
NSString *sex;
int age, height, weight;
}
// accessors
- (void)setPersonName:(NSString *)pName;
- (void)setPersonPic:(NSString *)pPic;
- (void)setPersonSex:(NSString *)pSex;
- (void)setAge:(int)pAge;
- (void)setHeight:(int)pHeight;
- (void)setWeight:(int)pWeight;

How would I create an array of Person and make each value go into the correct value?

Thanks for any help. Sorry once again for asking, but I haven't been able to figure it out on my own. _______________________________________________
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.
  • Follow-Ups:
    • Re: Files and arrays
      • From: Jim Balhoff <email@hidden>
    • Re: Files and arrays
      • From: "John C. Randolph" <email@hidden>
  • Prev by Date: Drawing lines within an NSTextView
  • Next by Date: Testing...
  • Previous by thread: Drawing lines within an NSTextView
  • Next by thread: Re: Files and arrays
  • Index(es):
    • Date
    • Thread