Re: Are there any NSUserDefaults keys which aren't valid?
Re: Are there any NSUserDefaults keys which aren't valid?
- Subject: Re: Are there any NSUserDefaults keys which aren't valid?
- From: j o a r <email@hidden>
- Date: Thu, 26 Jan 2006 21:34:15 +0100
On 26 jan 2006, at 20.59, Jonathan del Strother wrote:
NSDate* fileDate = [[[NSFileManager defaultManager]
fileAttributesAtPath:file traverseLink:YES]
objectForKey:NSFileModificationDate];
[1]
Do you guard against a nil return value from this method call? Note
that the sample code in the documentation for this method has such
guards!
Is it possible that your users are on some non-standard file system,
like NFS, FAT, et.c.? Perhaps you should try your app on something
like that and see how it works?
Note that all file attributes are not supported on all file systems!
I filed a bug about two years ago (still open) that
NSFileCreationDate returns *incorrect* values (ie. not *nil*, a date
from 1904 IIRC) on NFS.
That said, if this had been the problem - (nil == fileDate) - you
would have received an exception in "-setObject:forKey:", and not
when setting the value in user defaults.
[2]
The other variable that I forgot to ask about is the key "albumKey".
How to you generate it?
[3]
Are "fileDate" and "albumKey" both created in the same thread as
where you write to user defaults? If not, how are they passed to the
thread?
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden