Files and arrays
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.