Hi Martijn,
I’d take a look at custom persistent UIPasteboards. One advantage they have is that they can also be shared between apps and even outlast an app uninstall (unless you link the pasteboard name to the app bundle identifier). Then all you would need is to make sure your business logic class is NSCoding compliant so you can use NSKeyedArchiver with it.
At runtime you can resuscitate the state and attach it to the CB Service instance using objc_setAssociatedObject/objc_getAssociatedObject or Swift class extensions.
If it needs to be secure there’s always the keychain. But it won’t be as persistent as UIPasteboards.
Best, Ramin
On September 24, 2015 at 2:03:53 AM, Martijn The (email@hidden) wrote:
Hi there,
Is there a recommended way to store additional state for the
business logic behind a CB service, to make it survive app
crashes/jetsams? CB state restoration will resuscitate the services
etc., but not the state of our own business logic.
Thoughts?
Martijn
Pebble Time - Awesome Smartwatch, No Compromises
Tel: +1 (650) 308-9383 / +31(0)619151407
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|