CoreStore icon indicating copy to clipboard operation
CoreStore copied to clipboard

[Xcode 14.0 beta] Key path value type 'NSManagedObjectID' cannot be converted to contextual type 'ID'

Open ptrkstr opened this issue 3 years ago • 5 comments

Not sure if this is just a bug with the beta but the source no longer builds in this version of Xcode. Any ideas @JohnEstropia ? image

image

ptrkstr avatar Jun 13 '22 19:06 ptrkstr

Thanks, I'll go around with the Xcode 14 / iOS 16 changes within the week.

JohnEstropia avatar Jun 14 '22 02:06 JohnEstropia

Hey @JohnEstropia, I had a little look and these are the changes I found.

  1. MutableCollection.move(fromOffsets:toOffset:) previously had no minimum macOS version but is now macOS 10.15+. First time I've ever seen the same Apple API increase in minimum version. However this change doesn't appear in Apple's diff docs. This was resolved by updating swift-tools-version:5.1 and .macOS(.v10_15). This also applied to other platforms as well.
  2. The error above of Key path value type... seems to indicate that now it's not possible to use namespaced types inside a generic type. Referencing DynamicObject instead of O resolves this but I wish this wasn't necessary.
  3. Xcode warned that there was a place that nil was being checked for even though nil couldn't occur.

I'm hoping that 1 and 2 is reverted by the time RC comes out. Here is the diff if you'd like to see: https://github.com/JohnEstropia/CoreStore/compare/develop...ptrkstr:develop

ptrkstr avatar Jun 16 '22 10:06 ptrkstr

@ptrkstr Please try this branch out for now while we wait for fixes on (1) from Apple's side: minIOS13. Note that this branch drops iOS 12 support, since I'm planning to support Swift Structured Concurrency going forward.

(2) had been addressed here. I guess it makes sense that a static typealias should be declared in the protocol itself.

As for (3), the FieldStorableType 's generic type may contain optionals (FieldOptionalType) as well, so nil should be a valid value, but I understand that the compiler now needs a static type for nil. The minIOS13 branch also addresses it here, where luckily any FieldOptionalType can now be used in pattern matching.

JohnEstropia avatar Jun 19 '22 09:06 JohnEstropia

Thanks for getting around to that @JohnEstropia. It looks like it also needs the minimum platform versions updated in the package.swift. image

ptrkstr avatar Jun 22 '22 09:06 ptrkstr

@ptrkstr I updated Package.swift, sorry about that

JohnEstropia avatar Jun 22 '22 10:06 JohnEstropia

Hey @JohnEstropia sorry for the late reply. I've verified it's working with SPM now on the latest beta - Xcode Version 14.0 beta 5 (14A5294e). ~Maybe a rebase from develop and it could be good to go?~ Looks like it's not backwards compatible with Xcode 13.4.1 however. image

ptrkstr avatar Aug 13 '22 13:08 ptrkstr

@ptrkstr The latest beta updates are in develop now, and the error you see above is already addressed through a compiler directive: https://github.com/JohnEstropia/CoreStore/blob/e9219682b52d73dba4d8d561241149c5c5ae2f30/Sources/Where.swift#L201

JohnEstropia avatar Aug 16 '22 04:08 JohnEstropia

@JohnEstropia Any plans on creating a new release with it soon? We wanted to compile against iOS 16, but don't wanted to use your develop branch as dependency in the project.

tygore587 avatar Sep 08 '22 09:09 tygore587

@tygore587 Yes, Xcode 14 release candidate had been posted today so I'll be preparing a version support soon

JohnEstropia avatar Sep 08 '22 09:09 JohnEstropia

Just released CoreStore 9.0.0. Cheers!

JohnEstropia avatar Sep 13 '22 00:09 JohnEstropia

Thank you :) Anything we need to be aware of while upgrading from 8.1 to 9.0.0? :)

tygore587 avatar Sep 13 '22 07:09 tygore587

@tygore587 There should be nothing surprising, but Xcode 14 did raise practical minimum development versions (iOS and tvOS 13, watchOS 7.4, macOS 10.15)

JohnEstropia avatar Sep 13 '22 08:09 JohnEstropia

@JohnEstropia Okay thank you

tygore587 avatar Sep 13 '22 09:09 tygore587

is it possible to support ios 12 if using xcode 14?

jonhcbs avatar Sep 27 '22 06:09 jonhcbs

@maojoh I'll try to create a separate version (likely 8.2.0) for iOS 12 support, but it would be unmaintained from thereon out because I'm planning to use Combine utilities internally for upcoming updates.

JohnEstropia avatar Sep 27 '22 08:09 JohnEstropia

@JohnEstropia could you help support iOS 12? big thank. since we still need support iOS 12 device

jonhcbs avatar Feb 13 '23 03:02 jonhcbs