Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to store array of custom objects in nsuserdefaults?

$
0
0

I am able to store arrays of strings in nsuserdefaults, by doing:

    string voted[] = new string[] {"john", "harry"};
NSUserDefaults.StandardUserDefaults ["voted"] = NSArray.FromStrings (voted);

But suppose I have an array of custom voted objects such as:

voted allvoted[] = new voted[] { obj1, obj2, obj3);

How do I store this array in nsuserdefaults. I have seen some obj-c answers on stackoverflow but I am having lots of difficulty trying to translate the code to Xamarin c#.

Thanks


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>