Optional Code when Not Found
Thanks for that new code and the placement of it. I needed that information also.
Here is a slightly modified version that I tried (and it worked) for when the text file was not found; i.e., setting mydata with the default table values:
if (textFileContents == nil) {
NSLog(@"Error reading text file. %@", [error localizedFailureReason]);
myData = [[NSArray alloc] initWithObjects:@"Albert", @"Bill", @"Chuck", @"Dave", @"Ethan",@"Franny", @"George", @"Holly", @"Inez", nil];
}
else {
myData = [textFileContents componentsSeparatedByString:@"\n"];
}
__________________
GeezerRoy - Trying to Keep It Simple
|