Re: arrayWithContentsOfFile
Re: arrayWithContentsOfFile
- Subject: Re: arrayWithContentsOfFile
- From: DKJ <email@hidden>
- Date: Tue, 13 Oct 2009 12:52:36 -0700
On 2009-10-13, at 12:35 , I. Savant wrote:
Again, can you post your relevant code?
------------------------------------
NSArray *data;
data = [NSArray arrayWithContentsOfFile:[NSHomeDirectory()
stringByAppendingPathComponent:@"/Documents/file.plist"]];
if( data == nil )
do this;
------------------------------------
There's no file.plist in the directory. But "do this" doesn't get done.
However, "do this" does get done when I have this:
------------------------------------
if( [data count] == 0 )
do this;
------------------------------------
So it looks like arrayWithContentsOfFile: is returning an empty array
when file.plist doesn't exist.
dkj
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden