hmm.... looking at the class doc it seems I'll have to wrap them in an NSNumber or NSValue, then an NSArray, THEN an NSDictionary. Seems like that's taking the long way... and it doesn't help that I haven't used NSDictionary or successfully saved an object or variable before. I'll look into it more but I'd like more suggestions please.
I've no idea what you're using the array for. Create an NSMutableDictionary instance. Set each value you want to save for a sensible key. Write out via the writeToFile: method. No array...
When I don't care about tiny rounding errors, I just convert to string representation (sprintf), and write plain text files. Makes it much easier to dump the file to a text editor for debugging or printing, or for moving the data cross-platform.
When I don't care about tiny rounding errors, I just convert to string representation (sprintf), and write plain text files. Makes it much easier to dump the file to a text editor for debugging or printing, or for moving the data cross-platform.
Whilst this approach is perfectly sensible it does take more code, especially to reload. We can reload the dictionary from a file with one line of code