Thank you for the tips Dino!! I finally got a workaround in place and
working. The Preserve attribute gave me big hopes, but still couldn't get it
to work while I had the [Serializable] attribute. Here is what I did:
- I left my existing model without the [Serializable] attribute. It now has
[Preserve (AllMembers = true)]
- I create a new class with the exact same signature, called it "People" and
decorated it with [Serializable].
[Serializable]
public class People {
string _description;
string _firstName;
string _lastName;
public string Description {
get { return _description; }
set { _description = value; }
}
public string FirstName {
get { return _firstName; }
set { _firstName = value; }
}
public string LastName {
get { return _lastName; }
set { _lastName = value; }
}
}
Next when I'm ready to persist to the file I iterate the PeopleModel list
inside a foreach, create a new class from the serializable and add it to a
new list.
List<People> peopleList = new List<People>();
foreach (PeopleModel item in persons) {
People people = new People {
Description = item.Description,
LastName = item.LastName,
FirstName = item.FirstName
};
peopleList.Add(people);
}
... and then reverse the process when I serialize it from the binary file.
Sure would be nice to know what the issue is (or was), but at least it's
working and I can move on to the next frustration
Thanks again for the tips.
-----
There was only 1 trilogy
--
View this message in context:
http://monotouch.2284126.n4.nabble.com/the-requested-operation-cannot-be-completed-because-tp4017899p4018216.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch