Bug 11328 - Binding project with long property
Summary: Binding project with long property
Status: RESOLVED INVALID
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 6.2.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-03-21 14:52 UTC by jonathan_chapman
Modified: 2013-03-21 22:00 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description jonathan_chapman 2013-03-21 14:52:13 UTC
I have a class that is just made up of properties.

@interface Field : NSObject
@property long IntValue;
// Other properties
@end

When debugging on the simulator (iOS 6.1) everything is fine. When I run it on the device (iOS 6.1) the value in IntValue becomes a very large number.  If I change IntValue to be of type int with the same value everything is fine.
Comment 1 Sebastien Pouliot 2013-03-21 22:00:53 UTC
After years of .NET it becomes confusing to think that `long` is 4 bytes. That's true in C and ObjC. The .NET long (8 bytes) is `long long`.

http://reference.jumpingmonkey.org/programming_languages/objective-c/types.html

There's a few reason it might seems to work in some cases, e.g. memory alignment, having a 0 value neighbour.

Shameless plug: a good way to find such errors in bindings is to test them with unit tests. That's not as hard or complex as it sounds. Start reading http://blog.xamarin.com/producing-better-bindings-for-xamarin.ios-and-xamarin.mac/ for more details (more coming soon, including one specific to the binding signatures)