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

Binding Native NSUInteger[] Error

$
0
0

When I use Objective Sharpie to generate bindings, the following method:

- (int)printPDFAtPath:(NSString *)pdfPath pages:(NSUInteger [])indexes length:(NSUInteger)length copy:(int)nCopy;

gets bound as

int PrintPDFAtPath(string pdfPath, nuint[] indexes, nuint length, int nCopy);

The resulting generated code then contains the following code:

var nsa_indexes = NSArray.FromNSObjects (indexes);

which fails due to the fact that nuints are not NSObjects

Error CS1502: The best overloaded method match for `Foundation.NSArray.FromNSObjects(params Foundation.NSObject[])' has some invalid arguments (CS1502)
Error CS1503: Argument `#1' cannot convert `System.nuint[]' expression to type `Foundation.NSObject[]' (CS1503)

Is there a recommended approach to dealing with conversions like this?

Thanks,
Rob


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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