ios - Can I serialize an ACAccount object holding an authorized twitter account? -
ios - Can I serialize an ACAccount object holding an authorized twitter account? -
i have implemented built in twitter api, , working great, trying decide how best persist twitter business relationship between sessions when user has multiple twitter accounts set up.
if receive single acaccount
using -[acaccountstore accountswithaccounttype:]
, it's easy... utilize one. if, however, there multiple acaccounts
don't want asking them every time come in app 1 use.
the way see far, options are:
serialize acaccount
object using nskeyedarchiver
(this ideal, if possible)
bug user every time (don't want this)
store username of selected acaccount
, in next session compare username in each business relationship within acaccountstore
, , select business relationship (although reason seems inelegant workaround).
many in advance!
acaccount
has property named identifier
uniquely identify single account. type of property nsstring
can persist value either nsuserdefaults
or nscoding
(or whatever other persistence solution use). when want retrieve business relationship belongs identifier, utilize method -[acaccountstore accountwithidentifier:] , pass identifier parameter.
ios objective-c twitter acaccount
Comments
Post a Comment