• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Are there any NSUserDefaults keys which aren't valid?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Are there any NSUserDefaults keys which aren't valid?
      • From: Jonathan del Strother <email@hidden>
References: 
 >Are there any NSUserDefaults keys which aren't valid? (From: Jonathan del Strother <email@hidden>)
 >Re: Are there any NSUserDefaults keys which aren't valid? (From: j o a r <email@hidden>)
 >Re: Are there any NSUserDefaults keys which aren't valid? (From: Jonathan del Strother <email@hidden>)
 >Re: Are there any NSUserDefaults keys which aren't valid? (From: John Stiles <email@hidden>)
 >Re: Are there any NSUserDefaults keys which aren't valid? (From: j o a r <email@hidden>)
 >Re: Are there any NSUserDefaults keys which aren't valid? (From: Jonathan del Strother <email@hidden>)

  • Prev by Date: Re: NSFileManager and Finder disk usage discrepancy
  • Next by Date: Re: multiple iSight stream same time?
  • Previous by thread: Re: Are there any NSUserDefaults keys which aren't valid?
  • Next by thread: Re: Are there any NSUserDefaults keys which aren't valid?
  • Index(es):
    • Date
    • Thread