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

Double pointer to Xamarin.iOS NSMutableArray becomes null in Objective C layer

$
0
0
I am trying to pass a reference of an NSMutableArray from Xamarin.iOS which becomes null in Objective C layer.

Xamarin.iOS application

NSMutableArray arraySample = new NSMutableArray();

IntPtr availableHandle = arraySample.Handle;

var result = SampleLibrary.MutableArrayTest(out arraySample);
Objective C static library

+(NSMutableArray *)arrayReturningTesting:(NSMutableArray **)prameterArray
{
if ((prameterArray == nil) || (*prameterArray == nil))
{
NSLog(@prameterArray is null);
return nil;
}

NSMutableArray *arrayNumbers = [[NSMutableArray alloc]initWithObjects:@11, @12, nil];
NSMutableArray *finalArray = [[NSMutableArray alloc]init];
[arrayNumbers addObjectsFromArray:*prameterArray];
[finalArray addObjectsFromArray:arrayNumbers];
NSLog(@prameterArray is not null);

return finalArray;
}
Output : prameterArray is null Expected output : prameterArray is not null

Is there a solution for this?

Viewing all articles
Browse latest Browse all 204402

Trending Articles



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