I'd like to able to get a unique ID for an object so that I can later test another object against it, without having to keep the first object. Say I have an NSArray
of NSDictionaries
that describes some sort of playlist (not the best way to store data but for arguments sake). Its too big to store, and the user may have many of them; everytime the user uses the application I just download it again. I want to be able to offer the user the ability to continue the playlist from his last location but only if the playlist is exactly the same (say its some sort of feed that updates regularly, but always has the same count). Is there some sort of quick way to ID that object into a small'fingerprint' object, and then test the new playlists fingerprint against it? Obviously it doesn't have to be perfect (otherwise it would be the whole object), just something unique enough to test 'likely' equality. (Note: I'd prefer a solution that worked for any NSObject-not just an NSArray of NSDictionaries).
My naive approach was to just concatenate the first the first three letters of all of the NSStrings
in each NSDictionary
- that seems silly.