Is it possible to have an NSdictionary where the keys are NSDates and also have it writeable/archiveable to disk?
相关问题
- Check if NSDate is in this week or next week
- NSOutlineView drag line stuck + blue border
- iphone sdk see size of local file (one created
- How can you detect the connection and disconnectio
- NSDictionary description not returning utf8 charac
相关文章
- Converting (u)int64_t to NSNumbers
- “getter” keyword in @property declaration in Objec
- NSMenuItem KeyEquivalent “ ”(space) bug
- Detect if cursor is hidden on Mac OS X
- NSNumberFormatter doesn't allow typing decimal
- Is subclassing NSNotification the right route if I
- Escape NSDateFormatter String
- Creating an NSMutableArray with a literal via muta
Not using property lists, as only string keys are allowed there. You should be able to write it using
NSKeyedArchiver
, but that has the disadvantage of being a more opaque format. Alternatively, you could of course make a copy of the dictionary where you convert the dates to strings.Yes, this should work just fine - and NSDate elements are also suitable for plist encoding. Might depend on the value you put in as values, though.
If you experience problems, please update your question with code.