Post

Replies

Boosts

Views

Activity

UITextView in Catalyst, Input Source's character picker panel cover's characters
I made a note app. Some user reports me a bug. When typing with Chinese Pinyin input source, character picker panel will covers characters in UITextView. Xcode 12.4 MacOS 11.2.3 Demo: class ViewController: UIViewController { let tv: UITextView = UITextView(frame: CGRect(x: 50, y: 50, width: 600, height: 200)) override func viewDidLoad() { super.viewDidLoad() view.addSubview(tv) } }
0
0
365
Mar ’21
CoreData + CloudKit crash _referenceData64
I'm making a note app. sync data use CoreData + CloudKit. Have two Entity named 'Cardbag' And 'Card'. Cards has a to-one nullify relationship to CardPack named pack.  CardPack has a to-many cascade relationship to Card named cards.  follow those STEPS: 1 on device A, create a CardPack NSManagedObject, save, and wait cloudkit sync to device B. let cardpack = CardPack(context: Database.viewContext) try! Database.viewContext.obtainPermanentIDs(for: [cardpack]) cardpack.uuid = UUID.simpleID cardpack.name = "test" try! Database.viewContext.save() 2 when cardpack synced to device B. on device A, create 500 Cards NSManagedObject, and set card.pack = cardpack, save. Database.viewContext.performAndWait { &#9;&#9;for i in 0..<500 { &#9;&#9;&#9;&#9;let card: Card&#9;= Card(context: Database.viewContext) &#9;&#9;&#9;&#9;try! Database.viewContext.obtainPermanentIDs(for: [card]) &#9;&#9;&#9;&#9;card.uuid = UUID.simpleID &#9;&#9;&#9;&#9;card.pack = pack &#9;&#9;} &#9;&#9;try! Database.viewContext.save() } 3 device B, see Xcode console, when card records download from cloudkit server started, delete cardpack on device B quickly. let context = Database.viewContext context.performAndWait { &#9;&#9;guard let pack = (try? context.existingObject(with: packMOID)) as? CardPack else { return } &#9;&#9;context.delete(pack) &#9;&#9;try? context.save() } then, crash. Crash Error: Terminating app due to uncaught exception CoreData: debug: CoreData+CloudKit: -[PFMirroredOneToManyRelationship updateRelationshipValueUsingImportContext:andManagedObjectContext:error:](424): Linking object with record name <CKRecordID: 0x281a8c7c0; recordName=9FFDDFE1-FEB2-45B7-A51F-F95719891BA2, zoneID=com.apple.coredata.cloudkit.zone:defaultOwner> to <CKRecordID: 0x281a8c9c0; recordName=D7930F69-180E-4683-95F3-27CD394FFC91, zoneID=com.apple.coredata.cloudkit.zone:defaultOwner> via pack 2020-09-14 17:27:54.901348+0800 TwinklingCard[740:60405] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -_referenceData64 only defined for abstract class.&#9;Define -[NSTemporaryObjectID_default _referenceData64]!' First throw call stack: (0x190f19344 0x190c2ecc0 0x19144f66c 0x195a153c8 0x1959b8a3c 0x195acacb8 0x195a0b650 0x1958d722c 0x195ac93bc 0x195ac92e4 0x195af9488 0x195a0b650 0x104f4b4d8 0x104f5ae14 0x1958d725c 0x195af9084 0x195b4d4d4 0x195af8e38 0x195afab80 0x1959ce1ac 0x195afaad8 0x104f4b4d8 0x104f5ae14 0x195afaa28 0x195af7ed4 0x19606ea10 0x196027418 0x1960226d8 0x1960b6afc 0x104f5a7c4 0x104f4b4d8 0x104f52c20 0x104f53868 0x104f5f270 0x190c21718 0x190c279c8) libc++abi.dylib: terminating with uncaught exception of type NSException Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -_referenceData64 only defined for abstract class.&#9;Define -[NSTemporaryObjectID_default _referenceData64]!' terminating with uncaught exception of type NSException I think things maybe like this: sync system making relationships with pack and cards. I delete pack. system can't find pack NSManagedObject, then crash. but, How can I handle it?
0
0
759
Sep ’20