Firstly, can you verify that the file exists where you are looking and is readable?
Use
[[NSFileManager defaultManager] isReadableFileAtPath:aPath];
Secondly, what is in your file. The behaviour of initWithContentsOfFile:
The array representation in the file identified by aPath must contain only property list objects (NSString, NSData, NSArray, or NSDictionary objects).
Is your file a valid plist xml file?
InResponse
You cannot use the NSArray constructor initWithContentsOfFile: to parse a regular text file.
Instead you can read the file content into memory and parse it yourself into an array. For your example you could use
//pull the content from the file into memory
NSData* data = [NSData dataWithContentsOfFile:aPath];
//convert the bytes from the file into a string
NSString* string = [[[NSString alloc] initWithBytes:[data bytes]
length:[data length]
encoding:NSUTF8StringEncoding] autorelease];
//split the string around newline characters to create an array
NSString* delimiter = @"
";
NSArray* items = [string componentsSeparatedByString:delimiter];
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…