[CoreData] Implement Xcode 16.0 beta 1-6 changes. (#21113)

Note: there were no changes in beta 1, beta 2, beta 3, beta 5 or beta 6.
This commit is contained in:
Rolf Bjarne Kvinge 2024-09-05 09:40:50 +02:00 коммит произвёл GitHub
Родитель 3de8349a9d
Коммит 7dd8f3ef7c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
13 изменённых файлов: 118 добавлений и 13 удалений

Просмотреть файл

@ -0,0 +1,23 @@
#if NET
using System;
using System.Runtime.Versioning;
using System.Runtime.InteropServices;
using ObjCRuntime;
namespace CoreData {
public partial class NSPersistentStoreCoordinator {
#if !__TVOS__
[SupportedOSPlatform ("macos15.0")]
[SupportedOSPlatform ("ios18.0")]
[SupportedOSPlatform ("maccatalyst18.0")]
[UnsupportedOSPlatform ("tvos")]
public NSManagedObjectID GetManagedObjectId (string value)
{
using var str = new TransientString (value);
return GetManagedObjectId ((IntPtr) str, (nuint) value.Length);
}
#endif // !__TVOS__
}
}
#endif

Просмотреть файл

@ -64,6 +64,10 @@ namespace CoreData {
[Watch (7, 0), TV (14, 0), Mac (11, 0), iOS (14, 0), MacCatalyst (17, 0)]
[Field ("NSPersistentStoreDeferredLightweightMigrationOptionKey")]
NSString DeferredLightweightMigrationOptionKey { get; }
[Watch (11, 0), TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
[Field ("NSPersistentStoreModelVersionChecksumKey")]
NSString ModelVersionChecksumKey { get; }
}
/// <summary>Enumerates valid keys for the user information dictionary used in <see cref="P:CoreData.NSPersistentStoreCoordinator.StoresWillChangeNotification" /> and <see cref="P:CoreData.NSPersistentStoreCoordinator.StoresDidChangeNotification" />.</summary>
@ -2374,6 +2378,10 @@ namespace CoreData {
[Watch (7, 0), TV (14, 0), Mac (11, 0), iOS (14, 0), MacCatalyst (14, 0)]
[Export ("finishDeferredLightweightMigrationTask:")]
bool FinishDeferredLightweightMigrationTask ([NullAllowed] out NSError error);
[NoWatch, NoTV, Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
[Export ("managedObjectIDFromUTF8String:length:")]
NSManagedObjectID GetManagedObjectId (IntPtr utf8String, nuint length);
}
interface NSPersistentStoreCoordinatorStoreChangeEventArgs {

Просмотреть файл

@ -460,6 +460,7 @@ COREDATA_API_SOURCES = \
COREDATA_SOURCES = \
CoreData/NSEntityDescription.cs \
CoreData/NSPersistentStoreCoordinator.cs \
CoreData/Obsolete.cs \
# CoreFoundation

Просмотреть файл

@ -29636,6 +29636,8 @@ M:CoreData.NSPersistentStoreCoordinator.Execute(CoreData.NSPersistentStoreReques
M:CoreData.NSPersistentStoreCoordinator.FinishDeferredLightweightMigration(Foundation.NSError@)
M:CoreData.NSPersistentStoreCoordinator.FinishDeferredLightweightMigrationTask(Foundation.NSError@)
M:CoreData.NSPersistentStoreCoordinator.GetCurrentPersistentHistoryToken(Foundation.NSObject[])
M:CoreData.NSPersistentStoreCoordinator.GetManagedObjectId(System.IntPtr,System.UIntPtr)
M:CoreData.NSPersistentStoreCoordinator.GetManagedObjectId(System.String)
M:CoreData.NSPersistentStoreCoordinator.GetMetadata(CoreData.NSPersistentStore)
M:CoreData.NSPersistentStoreCoordinator.GetMetadata(System.String,Foundation.NSUrl,Foundation.NSDictionary,Foundation.NSError@)
M:CoreData.NSPersistentStoreCoordinator.Lock
@ -60727,6 +60729,7 @@ P:CoreData.UserInfoKeys.AffectedStoresForErrorKey
P:CoreData.UserInfoKeys.DeferredLightweightMigrationOptionKey
P:CoreData.UserInfoKeys.DetailedErrorsKey
P:CoreData.UserInfoKeys.KeyForValidationErrorKey
P:CoreData.UserInfoKeys.ModelVersionChecksumKey
P:CoreData.UserInfoKeys.ObjectForValidationErrorKey
P:CoreData.UserInfoKeys.PersistentStoreSaveConflictsKey
P:CoreData.UserInfoKeys.PredicateForValidationErrorKey

Просмотреть файл

@ -0,0 +1,83 @@
//
// Unit tests for NSPersistentStoreCoordinator
//
#if !TVOS
using System;
using System.Linq;
using CoreData;
using Foundation;
using NUnit.Framework;
namespace MonoTouchFixtures.CoreData {
[TestFixture]
[Preserve (AllMembers = true)]
public class NSPersistentStoreCoordinatorTest {
#if NET
[Test]
public void GetManagedObjectId ()
{
TestRuntime.AssertXcodeVersion (16, 0);
using var managedObjectModel = new NSManagedObjectModel ();
// create an entity description
var entity = new NSEntityDescription ();
entity.Name = "Earthquake";
// create an attribute for the entity
using var date = new NSAttributeDescription ();
date.AttributeType = NSAttributeType.Date;
date.Name = "date";
date.Optional = false;
using var latitude = new NSAttributeDescription ();
latitude.AttributeType = NSAttributeType.Double;
latitude.Name = "latitude";
latitude.Optional = false;
using var location = new NSAttributeDescription ();
location.AttributeType = NSAttributeType.String;
location.Name = "location";
location.Optional = false;
using var longitude = new NSAttributeDescription ();
longitude.AttributeType = NSAttributeType.Double;
longitude.Name = "longitude";
longitude.Optional = false;
using var magnitude = new NSAttributeDescription ();
magnitude.AttributeType = NSAttributeType.Float;
magnitude.Name = "magnitude";
magnitude.Optional = false;
using var USGSWebLink = new NSAttributeDescription ();
USGSWebLink.AttributeType = NSAttributeType.String;
USGSWebLink.Name = "USGSWebLink";
USGSWebLink.Optional = false;
// assign the properties to the entity
entity.Properties = new NSPropertyDescription [] {
date,
latitude,
location,
longitude,
magnitude,
USGSWebLink
};
// add the entity to the model, and then add a configuration that
// contains the entities
managedObjectModel.Entities = new NSEntityDescription [] { entity };
managedObjectModel.SetEntities (managedObjectModel.Entities, String.Empty);
using var psc = new NSPersistentStoreCoordinator (managedObjectModel);
Assert.IsNull (psc.GetManagedObjectId ("magnitude"), "GetManagedObjectId");
}
#endif // NET
}
}
#endif // !TVOS

Просмотреть файл

@ -1,2 +0,0 @@
!missing-field! NSPersistentStoreModelVersionChecksumKey not bound
!missing-selector! NSPersistentStoreCoordinator::managedObjectIDFromUTF8String:length: not bound

Просмотреть файл

@ -1,2 +0,0 @@
!missing-field! NSPersistentStoreModelVersionChecksumKey not bound
!missing-selector! NSPersistentStoreCoordinator::managedObjectIDFromUTF8String:length: not bound

Просмотреть файл

@ -1,2 +0,0 @@
!missing-field! NSPersistentStoreModelVersionChecksumKey not bound
!missing-selector! NSPersistentStoreCoordinator::managedObjectIDFromUTF8String:length: not bound

Просмотреть файл

@ -1 +0,0 @@
!missing-field! NSPersistentStoreModelVersionChecksumKey not bound

Просмотреть файл

@ -1,2 +0,0 @@
!missing-field! NSPersistentStoreModelVersionChecksumKey not bound
!missing-selector! NSPersistentStoreCoordinator::managedObjectIDFromUTF8String:length: not bound

Просмотреть файл

@ -1,2 +0,0 @@
!missing-field! NSPersistentStoreModelVersionChecksumKey not bound
!missing-selector! NSPersistentStoreCoordinator::managedObjectIDFromUTF8String:length: not bound

Просмотреть файл

@ -1 +0,0 @@
!missing-field! NSPersistentStoreModelVersionChecksumKey not bound

Просмотреть файл

@ -1 +0,0 @@
!missing-field! NSPersistentStoreModelVersionChecksumKey not bound