Post

Replies

Boosts

Views

Activity

Reply to Invalid code signing entitlements with app group on macOS
So I: Added the REGISTER_APP_GROUPS custom build setting to all my macOS targets. Removed and re-added the App Groups capability using the iOS group format (it was already in this format, but I did it anyway) Verified that the entitlement in the built product is correct. Deleted the profile with the UUID found in the built product, following the same steps used by Quinn to fix the distribution build. Selected Product > Build But I stil get the same error when submitting to App Store Connect. I also tried disabling automatic signing and using a manually generated profile from the Developer website, but the error continues. Is there anything else I need to do to be able to submitting it to App Store Connect?
Topic: Code Signing SubTopic: Entitlements Tags:
Feb ’25
Reply to How to sort my Core Data entities using the new query properties from AppIntents
I found a solution thanks to this Gist. There's no way to directly convert from an EntityQuerySort to an NSSortDescriptor. Instead, we have to convert it manually: private func toSortDescriptor(_ sortedBy: [Sort<ArtistEntity>]) -> [NSSortDescriptor] { var sortDescriptors = [NSSortDescriptor]() if let sort = sortedBy.first { switch sort.by { case \.$name: sortDescriptors.append(NSSortDescriptor(keyPath: \EArtist.name, ascending: sort.order == .ascending)) default: break } } return sortDescriptors }
Aug ’22
Reply to How to get the page URL shared via the Share button on macOS?
Turns out that the NSSecureCoding content was the URL, but in hexadecimal. Here's how I'm converting it to String: let urlHex = dict.debugDescription .replacingOccurrences(of: "Optional(", with: "") .replacingOccurrences(of: ")", with: "") .replacingOccurrences(of: "<", with: "") .replacingOccurrences(of: ">", with: "") .replacingOccurrences(of: " ", with: "") guard let urlHexData = Data(fromHexEncodedString: urlHex) else { return } guard let url = String(data: urlHexData, encoding: .utf8) else { return } extension Data { // From http://stackoverflow.com/a/40278391 init?(fromHexEncodedString string: String) { func decodeNibble(u: UInt16) -> UInt8? { switch(u) { case 0x30 ... 0x39: return UInt8(u - 0x30) case 0x41 ... 0x46: return UInt8(u - 0x41 + 10) case 0x61 ... 0x66: return UInt8(u - 0x61 + 10) default: return nil } } self.init(capacity: string.utf16.count/2) var even = true var byte: UInt8 = 0 for c in string.utf16 { guard let val = decodeNibble(u: c) else { return nil } if even { byte = val << 4 } else { byte += val self.append(byte) } even = !even } guard even else { return nil } } }
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’22
Reply to Swift, iOS15, UIKit, CollectionView header issue
I'm having this exact same problem. Here's my error message: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'the view returned from -collectionView:viewForSupplementaryElementOfKind:atIndexPath: does not match the element kind it is being used for. When asked for a view of element kind 'UICollectionElementKindSectionHeader' the data source dequeued a view registered for the element kind 'FeedCollectionViewHeader'.'
Topic: Community SubTopic: Apple Developers Tags:
Jun ’21