iOS Question NativeObject

stevel05

Expert
Licensed User
Over the last few days I have been looking at NativeObject and have come across a problem more than once where by the required parameter is NSUInteger.

One thing I'm looking at is using UIViewAutoresizing, it has an enum structure:

B4X:
enum {
   UIViewAutoresizingNone                 = 0,
   UIViewAutoresizingFlexibleLeftMargin   = 1 << 0,
   UIViewAutoresizingFlexibleWidth        = 1 << 1,
   UIViewAutoresizingFlexibleRightMargin  = 1 << 2,
   UIViewAutoresizingFlexibleTopMargin    = 1 << 3,
   UIViewAutoresizingFlexibleHeight       = 1 << 4,
   UIViewAutoresizingFlexibleBottomMargin = 1 << 5
};
typedef NSUInteger UIViewAutoresizing;
My question is two fold. First, would it be possible to add something like MakeUInt to the NativeObject methods? and second, is it possible to access the enum structure using NativeObject?

What would be the best way to approach something like this?
 

stevel05

Expert
Licensed User
You can pass a regular int instead of NSUInteger.
Yes of course, try it again and it works now. I don't know what I did differently yesterday. :)

Thanks Erel.
 
Top