causing
```
Introspection.MacApiCtorInitTest.ApiCtorInitTest.DefaultCtorAllowed: 1 potential errors found in 925 default ctor validated:
Default constructor not allowed for CoreData.NSCoreDataCoreSpotlightDelegate : Could not create an native instance of the type 'CoreData.NSCoreDataCoreSpotlightDelegate': the native class hasn't been loaded.
It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.
```
when running intro for mac unified 32 bits
This is step 1 in not having to generate generator.csproj, since we can
reference the rsp files statically instead of injecting the actual command
line arguments to the generator for the debugging run configurations.
It also makes sure the project's run configurations are always up to date,
since they're using the exact same input as the command line build.
AVMediaTypeTimedMetadata has been obsoleted since iOS 6 but was totally
removed (returns null) in iOS 12.
Adjust test and provide a (better) deprecation warning for developers.
We have a test for CGFunction, and in iOS 12 the behavior changed where
previously the CGFunction was invoked immediately when rendering, it's now
retained and only called later.
This is troublesome for the test, because it disposes the managed CGFunction
when it thinks it's completed. Since the function is invoked way later, the
test now crashes. Ops.
The obvious fix is to change the test to dispose the CGFunction later. This
falls flat when finding out that "later" is undetermined. Native code retains
the CGFunction, and can do whatever it wishes with it until it's released, and
there's no way to know when that is.
OK: what about not disposing the CGFunction, and letting the GC do its job?
This also falls flat, because there's a circular reference between the native
CGFunction and the managed wrapper, preventing any of them from being released
automatically by the GC. The only way to break the circular reference is to
dispose the managed wrapper.
So, can we fix the circular reference? Unfortunately not, because we can't
monitor the native CGFunction's retain count, which is required in order to
switch the native->managed link between weak and strong according to the
retain count.
This leaves one solution (that I could come up with at least): make sure
everything works fine after disposing the managed wrapper.
This involves a few things:
* Only break the native->managed connection (the 'gch' GCHandle) when the
native CGFunction is freed. This is accomplished by using the API provided
by Apple for exactly that purpose (the 'release' callback field in the
'CGFunctionCallbacks' struct).
* Use a static variable for the 'CGFunctionCallback' struct and its contents.
This solves another potential problem: the GC could have collected the
delegate to the 'EvaluateCallback' function at any point.
* Don't null out the 'evaluate' delegate in Dispose. This leaves the user with
no way to break a potential circular reference through that delegate (since
it will never be null), so provide a property that makes it possible for
users to explicitly null out the delegate ('EvaluateFunction').
* Only call the 'evaluate' callback if it's not null.
This also has the additional advantage that test (and any customer code
running into the same issue) works without modifications.
Randomly make 3.81 says this:
error CS0006: Metadata file 'build/ios/reference/MonoTouch.Dialog-1.dll' could not be found
The makefile seems fine, and it also doesn't happen when using make 4.21, so
this looks like a make bug.
So rewrite the troublesome rule to not be a pattern rule, and cross some fingers.
The generator had a small bug in which we would get a NRE when a
property missed a Export attribute and had no WrapAttr. The issue is due
to the fact that an || is being used and does not shortcut when the
attribute is missing. In that case, the first Get check would pass and a
second attempt would happen with the set. In the case the set is missing,
we would get a NRE. The correct way is to ensure that we do have the get
and the set BEFORE the attr is checked.
The added test shows an example of the issue.
The public API was removed a long time ago (with XAMCORE_2_0) but
the p/invoke was still present in the platform assemblies.
Since tvOS requires bitcode this can cause a problem when linking
natively since a direct call won't be possible. That would only
happen if the symbol is removed (from the binary, not just the
headers) and if the managed linker is not enabled (otherwise it
will always be removed).
* [CoreGraphics] Add CGPDFArray.Get* overloads that take a nint index, since the CGPDFArray.Count property returns nint.
This makes the following code work:
for (var i = 0; i < array.Count; i++)
array.GetInt (i, ...)
* Don't add [MonoPInvokeCallback] to Mac code.
* [CoreGraphics] Rename CGPDFArray.ApplyBlockCallback to ApplyCallback.
Since the fact that the method is implemented using a block is not relevant
for managed code.
This also makes the method named like an equivalent method in CGPDFDictionary.
* [CoreGraphics] Change CGPDFArray.Apply to take an 'object' as the info parameter instead of IntPtr.
This makes it nicer for managed code.
* [CoreGraphics] CGPDFArray.Apply: resolve the iterated object to the actual CGPDFObject type.
* [CoreGraphics] Add an CGPDFDictionary.Apply overload that resolves the iterated object to the actual CGPDFObject type.
This method was previously only available in Classic, so I just reintroduced
it with a few changes to make the API nicer (which isn't a breaking change
since we're not building Classic anymore).
* [tests] Add test for CGPDF types.
* [tests] Don't run the new tests unless the SDK was part of Xcode 10
Apple removed `MPMoviePlayerController_iAdPreroll.h` in beta 5.
The deprecation existed, but indirectly, on `MPMoviePlayerController`,
the type on which the category is based. IOW it's became obsoleted so
we're adding the attributes to match this.
It's not worth it to have a helper function (Blocks.SimpleCall) for a single
API (NWConnection.Batch( that will never be widely used, when the cost is a
static field and the corresponding eternal memory usage for every app that
uses blocks at least once (which is pretty much every app).
* This is how it's defined in the RFC (#3582).
* It forces us to call InitializeHandle (or use the property setter, which
does the same thing), which makes it impossible to create broken types
(instantiating C# wrapper objects successfully, but with a null handle)
Two reasons:
* NativeObject.GetHandle looks too much like the existing
INativeObject.GetHandle, which has a different behavior.
* It's not clear from the name that it can easily throw exceptions. This
becomes particularly important with resource management (ensuring we don't
leak stuff if calling the method happens to throw an exception).
a service.
As per documentation the NWAdvertiseDescriptor CreateBonjourService
should always get a type. Added the change which fixes the introspection
failures.
* [CoreGraphics] Add first batch of Xcode10 APIs, added an enum that we did not surface before
* [xcode10] CoreGraphics support
* Fix whitespace/formatting and add comma after last enum value.
* Make CFPropertyList follow normal INativeObject creation pattern.
* Make CFPropertyList.AsData return the error as a tuple.
* Fix CFPropertyList.AsData to not leak.
* CFPropertyList.Value: use Runtime.GetNSObject so that we don't accidentally create duplicate wrappers for the same native object.
* [CoreGraphics] Update to beta 5.
* Update xtro definitions.
* Add tests.
* Don't compare value type with null.
* Use PascalCase for named return tuples.
* [CoreFoundation] Make CFPropertyList enums native and fix code accordingly.
* [tests] Fix fetching 64-bit int to actually fetch a 64-bit int and not a nint.
* [tests] Teach introspection's ApiCMAttachmentTest about CFPropertyList.
The default `Message` property is not every helpful. Better information
is available inside the `Error` property but it's not general (nor cross
platform) when dealing with exception.
Include unit tests (on an existing test checking NSError values)
https://github.com/xamarin/xamarin-macios/issues/4133
We want to remove the native API because it's prohibited and Apple could reject apps with it. Therefore we exposed empty stubs to avoid breaking the API.
* CoreFoundation/DispatchData: avoid possible integer overflow
* Network: move attributes for types introduced in Xcode10 from the
members to the types.
* Network: for callbacks that surface INativeObjects, rather than using
* Hide P/Invokes that are not currently surfaced so xtro tests can track this
* guidelines: Ip -> IP
* SecIdentity2: fix a leak by releasing the returned array, check for handle being null.
* SecTrust2: check for handle being null.
The comment: "'runWithConfiguration:' selector marked as unavailable in Xcode 9 beta 5"
was *wrongly* referencing 'NS_SWIFT_UNAVAILABLE("Use run(_:options:) instead")'. However that applies to swift and not objective-c, this selector is valid and lets users skip the options.
Note: tested with real-world ARKit app.
* Add None to ARSessionRunOptions
Apple re-added some constants that were dropped without any clue (and we
filed a rdar for it since it's a breaking change to remove them).
It's now clear that it's deprecated and why
`QC_GL_DEPRECATED(10_5, 10_14);`
so we can update the attribute (and fix the version).
note: also fix extra `;` in `CBUUIDValidRangeString` tests while removing
the special case added earlier (from beta 1)
This reverts commit 53fdc017a8.
Unfortunately there is not enough info for the AOT compiler to handle
MidiCIDeviceIdentification struct and this is causing mtouch tests to fail
- Updated some ARReferenceObject APIs based on their (better) Swift names. Breaking changes but on new APIs.
- Update ARReferenceObjectTest for device (center and extent have real values on device).
- Reuploaded an arobject file from Beta 3 just in case because of: "ARReferenceObject and ARWorldMap data generated using iOS 12 beta 2 or earlier isn’t compatible with beta 3 or later. Please rescan your objects to generate new ARReferenceObject and ARWorldMap data."
[tests] Run Xamarin.Mac tests on Mojave, and add more Xamarin.Mac tests.
* Add more Xamarin.Mac tests: introspection, link sdk, link all and xammac_tests.
* Fix TextureAtlasTest.Empty to not crash due to Apple not liking null callbacks. (#4003)
* Run Xamarin.Mac tests on Mojave as well, even though the build OS is an earlier OS (High Sierra).
Renamed and obsoleted 'FromBundle' in favor of 'CreateTexture' for consistency with new API and because I believe it was a mistake anyway.
For instance 'textureNamed:' was 'FromBundle', there's no mention of the bundle there.
* Bump for Xcode 10 beta 3
Include a few changes to have green builds, e.g. it seems
`[GKAchievement init]` and `[GKAchievement initWithIdentifier:nil]`
are different now
```
[FAIL] Default constructor not allowed for GameKit.GKAchievement : Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[GKAchievement identifier]: unrecognized selector sent to instance 0x6000004a48d0
[FAIL] iOSApiCtorInitTest.ApiCtorInitTest.DefaultCtorAllowed : 1 potential errors found in 1426 default ctor validated:
```
* [xtro] Fix EventKit
* [tests] Make intro tests green in macOS Mojave Beta 3
* [tests] Make xtro happy
Fixes the mlaunch build:
Xamarin.Hosting/SimulatorApplication.cs(183,51): error CS0120: An object reference is required for the non-static field, method, or property 'NSDistributedNotificationCenter.DefaultCenter'
Xamarin.Hosting/SimulatorApplication.cs(231,51): error CS0120: An object reference is required for the non-static field, method, or property 'NSDistributedNotificationCenter.DefaultCenter'
Xamarin.Hosting/Services.cs(1058,51): error CS0120: An object reference is required for the non-static field, method, or property 'NSDistributedNotificationCenter.DefaultCenter'
- As we can't change NSDistributedNotificationCenter.DefaultCenter return value outside of XAMCORE_4_0 add NSDistributedNotificationCenter.GetDefaultCenter () and point people to that for now.
- Fixed in XAMCORE_4_0 without the hack