Though your question is pretty... vague, one suggestion :
importing Spreadsheet-like data could easily be done by import the .csv
version (Comma-separated value) of a Spreadsheet.
A comma-separated values (CSV) file stores tabular data (numbers and
text) in plain-text form. Plain text means that the file is a sequence
of characters, with no data that has to be interpreted instead, as
binary numbers. A CSV file consists of any number of records,
separated by line breaks of some kind; each record consists of fields,
separated by some other character or string, most commonly a literal
TAB or comma. Usually, all records have an identical sequence of
fields.
Example :
Year,Make,Model,Length
1997,Ford,E350,2.34
2000,Mercury,Cougar,2.38
Then, you could simply :
(1) Load your csv file as a simple text file
NSString* contents = [NSString stringWithContentsOfFile:filename
encoding:NSUTF8StringEncoding
error:nil];
(2) Get the lines
NSArray* lines = [contents componentsSeparatedByString:@"
"];
(3) Parse each line's fields
for (NSString* line in lines)
{
NSArray* fields = [line componentsSeparatedByString:@","];
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…