Changing the linker settings didn't change the behaviour, I still see the
specified height in the simulator and a height of zero on the device.

I did notice that Animation is actually a struct not a class. If I change
it to a class then the height is correct on the device. So I guess it's a
copy / reference issue somewhere.

Thanks for your help.

On 30 May 2012 02:27, Sebastien Pouliot <[email protected]> wrote:

> Hello,
>
> First guess is that the simulator, by default, does not use the linker
> while the device builds are, again by default, using the linker.
>
> If the fields (or the getter or the setters) are not directly used in
> your application (serialization is done thru reflection) then they
> could be (all or only some) removed.
>
> It's easy to test, simply use "Link SDK" on the simulator and/or
> "Don't link" on device builds and see if it fails / work in the
> reversed condition.
>
> Regards,
> Sebastien
>
> On Tue, May 29, 2012 at 6:24 PM, Stoo Goff <[email protected]> wrote:
> > I'm trying to deserialise an XML file which contains a
> > System.Drawing.Rectangle. In the simulator everything works as expected,
> on
> > the device the Height of the rectangle is always 0.
> >
> > The code is:
> >
> > using(var stream = new FileStream(path, FileMode.Open, FileAccess.Read,
> > FileShare.ReadWrite)) {
> > var serialiser = new XmlSerializer(typeof(T));
> >
> > return (T) serialiser.Deserialize(stream);
> > }
> >
> > Where T is a List<Animation>, with the Animation class having a public
> > Rectangle property called DrawingRect. The XML looks like this:
> >
> > <Animation>
> > <ID>animation.options.gamecentre.active</ID>
> > <Texture>images/menus/option_menu_elements</Texture>
> > <DrawingRect>
> > <X>146</X>
> > <Y>97</Y>
> > <Width>72</Width>
> > <Height>72</Height>
> > </DrawingRect>
> > </Animation>
> >
> > The device is an iPhone 4S running iOS 5.0.1. MonoTouch is the latest
> > update. This is happening with every rectangle that's being deserialised,
> > not just this instance. Can anyone shed any light on why the height
> would be
> > zero?
> >
> > _______________________________________________
> > MonoTouch mailing list
> > [email protected]
> > http://lists.ximian.com/mailman/listinfo/monotouch
> >
>
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to