Re: How to save a Dictionary Network to a plist file?
Re: How to save a Dictionary Network to a plist file?
- Subject: Re: How to save a Dictionary Network to a plist file?
- From: Alex Zavatone <email@hidden>
- Date: Thu, 21 Jan 2016 19:44:51 -0500
You can use NSCoding to write the object out to disk and read it back.
If you want to convert it to a dictionary, you can save it as a pList
I’m spent right now, but if you’re interested I can send you my code for saving and restoring my lists of CLLocations using NSCoding. It will have to wait for tomorrow though.
I’d google around for NSCoding examples if you need something before then.
There’s also a good link to state restoration in this post:
https://www.reddit.com/r/iOSProgramming/comments/41wnxs/ios_data_serialization_ipc_vs_android/
https://www.reddit.com/r/iOSProgramming/comments/41wnxs/ios_data_serialization_ipc_vs_android/cz5r0p3
In any case, let me know if you want to take a look at the stuff I’ve got and I’ll send when I’m conscious.
GL.
Alex Zavatone
On Jan 21, 2016, at 7:36 PM, email@hidden wrote:
> I'm surprised nobody has mentioned JSON.
> You might later look at it.
> It can help sometimes by showing where a model is over engineered and can be simpler and more flexible and reusable, but it also might not fit.
>
> Sent from my iPhone
>
>> On Jan 22, 2016, at 2:05 AM, Dave <email@hidden> wrote:
>>
>> Hi All,
>>
>> I have Network of Dictionaries containing “LTWNodeInfo” Classes. LTWNodeInfo contains a Child Dictionary which in turn contains other LTWNodeInfo. The Key to these dictionaries is a Unique ID string called the NodeID.
>>
>> @interface LTWNodeInfo
>> @property (copy) NSString* pNodeID;
>> @property (copy) NSString* pNodeType;
>> @property (copy) NSMutableDictionary* pNodeChildDict;
>> @property (copy) LTWNodeInfo* pNodeParentt;
>>
>> @property (copy) NSString* pNodePayloadString1;
>> @property (copy) NSString* pNodePayloadString2;
>> @property (copy) NSString* pNodePayloadString3;
>> @end
>>
>>
>> This all works great and now I’d like to save this to a plist file and load it later on.
>>
>> My question is, what is the best way to do this? I was thinking I could make a dictionary out of the LTWNodeInfo Object and then create a Parallel Network using the dictionary versions, (I’d just use the Property names as the Key), but I was wondering if there is an easier way to do this?
>>
>> Any suggestions greatly appreciated.
>>
>> All the Best
>> Dave
>>
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden