The first-party options for data persistence in iOS and other Apple’s operating systems is already quite rich: Only choose a 3rd party technology when there is no built-in alternative or it provides “must-have” features that’s not available in the built-in one. This is the preferred way to persist simple structured data for applications in Apple’s operating systems. There are built-in facilities to store objects into property lists as well as load them back. On-disk they are typically either XML files having a. plist extension or its binary equivalent.
![devonthink to go devonthink to go](http://www.macdrifter.com/uploads/2018/11/IMG_0230.jpg)
![devonthink to go devonthink to go](https://cdn.cultofmac.com/wp-content/uploads/2010/10/devonthink-ipad-1.jpg)
This file format is widely used in the operating system. Every app has an ist file containing metadata about it. The User Defaults system is really a collection of property list files located in well-known places. The file format is widely used and documented, hence it won’t go away any time soon.Īdopting this is also quite simple. Confirm to the NSCoding protocol in your model objects and implement its methods to serialize and de-serialize the each property that you need persisted. Simple types such as numbers and strings can be encoded directly.
![devonthink to go devonthink to go](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/optimized/3X/b/b/bb42f38d0e534c9f327cf512106671a97e07c34a_2_937x750.jpeg)
Other object types can be encoded if it also confirms to NSCoding. Unlike JSON, property lists also encode data types in the serialized form – including class names. This enables you to use polymorphism inside your persisted data. For example in a drawing application you can just serialize a property containing an array of shapes and let individual subclasses write out their own special properties into the serialized form. #Devonthink to go add icloud database codeįile PackageĪlso known as a bundle, a file package is really a directory being shown to the user as if it were a single file.
#DEVONTHINK TO GO SOFTWARE#