Running this sample on device with the interpreter has spotted a few
issues in the sample.
Timing issue: Use DispatchGroup.Notify (like sample) instead of
Waiting (it's not the same) and remove the InvokeOnMainThread
since we're already running on that thread. Also uncomment some
code that, likely, did not work because Notify was not used;
Timing issue: composition can be null but it triggers an
ArgumentNullException (because the API does not officially accept
nil).
Enhancement: Set initial capacity of List<T> - just like it's
done in the original sample;
Simplification: There's no point in checking for null values inside
List<T> since that would have triggered an ArgumentNullException;
Simplification" There's no point in converting CMTimeRange into
NSValue (and back into CMTimeRange). In contrast to NSArray
we can add non-NSObject (including value type like struct) inside
List<T>;
Cleanup: remove ugly goto and use _ for unused out NSError
Running this sample on device with the interpreter has spotted a few issues in the sample.
Timing issue: Use
DispatchGroup.Notify
(like sample) instead ofWaiting
(it's not the same) and remove theInvokeOnMainThread
since we're already running on that thread. Also uncomment some code that, likely, did not work becauseNotify
was not used;Timing issue:
composition
can benull
but it triggers anArgumentNullException
(because the API does not officially acceptnil
).Enhancement: Set initial capacity of
List<T>
- just like it's done in the original sample;Simplification: There's no point in checking for
null
values insideList<T>
since that would have triggered anArgumentNullException
;Simplification" There's no point in converting
CMTimeRange
intoNSValue
(and back intoCMTimeRange
). In contrast toNSArray
we can add non-NSObject
(including value type like struct) insideList<T>
;Cleanup: remove ugly
goto
and use_
for unusedout NSError
This will fix https://github.com/xamarin/xamarin-macios/issues/5364