In a project I have to make, I am working with external accessories, and the framework ExternalAccessory.
(I can connect to one and only one accessory).
The connection is easy, sending data is not really difficult.
One thing I would like to do is to store in memory the last connected device, to try to reconnect to it automatically when the application relaunch. (after leaving, so after the first launch.)
So, my problem is that EAAccessory is a custom class object, and could not be stored into NSUserDefaults.
I saw this question to store custom objects :
How to store custom objects in NSUserDefaults
So I would create a NSData with it, but did not succeeded, because EAAccessory does not implements the encodeWithCoder and initWithCoder methods...
Any idea ? For this way or another way to process ?