Post

Replies

Boosts

Views

Activity

Transformable properties errors
I'm getting the following error messages:CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/0E3DF5FB-DA57-4A63-98FE-59E2961C6F50/Routes.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo'2020-01-11 17:19:50.885657-0600 Routes[1913:394464] [error] fault: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using "NSSecureUnarchiveFromData" when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable.. . .CoreData: warning: Property 'value' on Entity 'GMSCacheProperty' is using nil or an insecure NSValueTransformer. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead.. . .2020-01-11 17:20:08.491131-0600 Routes[1913:394093] Can't end BackgroundTask: no background task exists with identifier 13 (0xd), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.I don't know what the problem is because I am not using any CoreData Attributes of type Transformable nor is there any code in my project about anything transformable. I have searched with Google for this error, but have not found a solution that works.
4
0
3.0k
Sep ’21
iOS Contacts Framework Change History Data using Swift and Xcode 13
On Apple's documentation of the Contacts Framework for iOS and Swift on their developer website, there is a section called Change History Data. It consists of a list of classes and one protocol. The protocol seems to be the most important item of the list - the CNChangeHistoryEventVisitor protocol. The protocol apparently has instance methods each of which use one of those classes listed. Where do I find documentation to use this protocol and these classes? Anyone ever use these before? Here's the list: class CNChangeHistoryAddContactEvent class CNChangeHistoryAddGroupEvent class CNChangeHistoryAddMemberToGroupEvent class CNChangeHistoryAddSubgroupToGroupEvent class CNChangeHistoryDeleteContactEvent class CNChangeHistoryDeleteGroupEvent class CNChangeHistoryDropEverythingEvent class CNChangeHistoryEvent class CNChangeHistoryFetchRequest class CNChangeHistoryRemoveMemberFromGroupEvent class CNChangeHistoryRemoveSubgroupFromGroupEvent class CNChangeHistoryUpdateContactEvent class CNChangeHistoryUpdateGroupEvent protocol CNChangeHistoryEventVisitor
3
0
1.8k
Mar ’22
What do the different cases of the enumeration Data.Deallocator mean?
I'm having trouble finding explanations for the different cases of Data.Deallocator enumeration. It's used with the [init(bytesNoCopy:count:deallocator:) initializer to Data class] (https://developer.apple.com/documentation/foundation/data/1780455-init) Here's the different cases: Data.Deallocator. The cases are: custom free none unmap virtualMemory Anyone know a website that explains those cases briefly and simply? Or do you know what they mean off the top of your head?
3
0
458
Mar ’22
[AXRuntimeCommon] AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:963
I have this error: [AXRuntimeCommon] AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:963 It is preceded by lots of this message, if it matters: [Assert] +[UIInputViewSetPlacementInvisible placementWithPlacement:]: Should not be called with an invisible placement I thought it was because I didn't include a key in Info.plist, but I put keys in there that I thought might be needed. I am using CloudKit sharing and silent push notifications for CloudKit subscriptions, and the Apple documentation says when I set the capabilities for background fetch and remote notifications, the keys would be put in Info.plist by Xcode. Does this have anything to do with the fact that when my app is run for the first time it asks the user for permission to send notifications. If it's a silent notification that I'm using, I thought the documentation meant the user is not notified at all? I have searched on the internet and on stack overflow and in Apple developer forums for a solution. Any help will be appreciated.
3
0
6.8k
Jun ’23
How do I store FileManager.ubiquityIdentityToken?
I need any kind of help I can get on this question and am open to any solutions or workarounds. When I archive FileManager.ubiquityIdentityToken with NSKeyedArchiver.archivedData(withRootObject:requiringSecureCoding:), what should I set the second parameter to in order to be able to unarchive later, and how do I unarchive the Data object using unarchivedObject(ofClass:from:) or any other method of NSKeyedUnarchiver? My code currently uses the deprecated method of archivedData(withRootObject:), which gives me a code time warning saying: 'archivedData(withRootObject:)' was deprecated in iOS 12.0: Use +archivedDataWithRootObject:requiringSecureCoding:error: instead I'm getting code time error messages in red for the argument to archivedData(withRootObject:requiringSecureCoding:) which is declared as type Any. I tried different arguments. The one I this should work is (NSCoding & NSCopying & NSObject).Type, which generates two error messages: Static method 'unarchivedObject(ofClass:from:)' requires that '(NSObject & NSCoding & NSCopying).Type' inherit from 'NSObject' Type '(NSObject & NSCoding & NSCopying).Type' cannot conform to 'NSCoding' Setting the argument to (NSCoding & NSCopying & NSObject) generates the error message: 'NSObject & NSCoding & NSCopying' cannot be used as a type conforming to protocol 'NSCoding' because 'NSCoding' has static requirements I haven't been able to discover what that means that 'NSCoding' has static I get the idea to use (NSCoding & NSCopying & NSObject) because when run code: print("type of FileManager.default.ubiquityIdentityToken: \(type(of: FileManager.default.ubiquityIdentityToken))") the debug window shows type of FileManager.default.ubiquityIdentityToken: Optional<NSCoding & NSCopying & NSObject> but when I run the following code print("type of FileManager.default.ubiquityIdentityToken: \(type(of: FileManager.default.ubiquityIdentityToken!))") I get the following in the debug window type of FileManager.default.ubiquityIdentityToken: _NSInlineData I read on stackoverflow that "_NSInlineData" is not made available to us by Apple. I'm open to doing this any other way, not necessarily with NSKeyedArchiver or NSKeyedUnarchiver, including using unsafe pointers if necessary. In one of Apple's documentation or sample Xcode projects, I found code to check the login status of a user on iOS when an app logs on by checking FileManager.ubiquityIdentityToken and to check the current status with the previous status by checking the ubiquityIdentityToken that was saved in UserDefaults. Is there a better way of doing this?
3
1
1.8k
Jul ’22
How do I avoid nested closures or clauses?
I need to take some suggestions from other programmers about something. When we have to use an asynchronous closure, often because the Framework provides only an asynchronous method for something we can't do without, it seems to prevent us from using the guard statement, which we need to make the code easier to read. The guard statement keeps us from making nested if statements, which makes the code difficult to read if there are many lines of code within a set curly braces. I would see a closing curly brace, and not be able to see the what the if condition is for that if clause (what's between the set of curly braces). Putting comments at the closing curly brace works, but that means I would still have to find the if condition at the beginning of the if clause. I could collapse the clause where the curly braces closes a clause, but then I have to find that collapsed clause, because Xcode scrolls the content of the editor upward, so that the beginning of the clause is hidden upwards toward the top, and I don't know how far up it is. This problem that the guard statement solves is also a problem with completion handlers, which we have to have with any asynchronous code. One approach to this problem is to avoid nested curly braces. How do I do that when I have to have asynchronous clause of code? If there is someway I can return a variable of type Result from a function the classical way instead of in a completion handler, I could avoid nested closures or clauses. One way I've found is to use the DispatchSemaphore or any statement to instructs code execution to wait for an asynchronous closure end and then return. There's something I don't like about this that I'm not sure what it is. Anytime there is a code instruction to wait, it makes me uncertain to its effectiveness. One thing that would help is if Xcode would show in the editor the beginning of collapsed code, so that when I click on the left side of the code editor to collapse a closure/clause when I'm seeing the bottom of the closure, Xcode would scroll downward so that the code editor shows me the code at the beginning of the clause, so that I wouldn't have to scroll upward to find the code that introduces the clause of code. I could file a bug report with Apple. Anyone have any contributions to any solutions to this problem? By the way, what is the Apple or Swift word for I'm calling a clause? What, for example, is the code that is enclosed between curly braces? Am I using the words clause and closure each time I used them?
3
0
1.6k
Aug ’22
How do I get the value of UITextField text instance property and update UITableView row whenever the user edits the UITextField text property?
0 How would I update a table view row as as a text field text changes? It is difficult to create a string from the arguments in textField(:shouldChangeCharactersIn:replacementString:) so that the string I create would be equal to the string value of the text property of the text field after the textField(:shouldChangeCharactersIn:replacementString:) occurs. Is there a way to use the UITextInput protocol of UITextField? I haven't found anything on stackoverflow about using the UITextInput protocol of UITextField except a question in 2012 using Objective-C that asks why he's getting a crash.
3
0
1.4k
Oct ’22
Error message "Thread 10: EXC_BREAKPOINT (code=1, subcode=0x10515fd44)" in Xcode
I have been getting these error messages in debug window in Xcode: 2023-06-06 07:46:15.412684-0500 Courier[8456:442818] [LayoutConstraints] Unsupported layout off the main thread for _UIModernBarButton with nearest ancestor view controller, UINavigationController 2023-06-06 07:46:15.413268-0500 Courier[8456:442818] [Assert] -[UIImageView _invalidateImageLayouts] must be called on the main queue 2023-06-06 07:46:15.413730-0500 Courier[8456:442818] [Assert] -[UIImageView _layoutForImage:inSize:cachePerSize:forBaselineOffset:] must be called on the main queue (lldb) The messages come when my code crashes and gives this error message in a red ribbon in the editor window: Thread 10: EXC_BREAKPOINT (code=1, subcode=0x10515fd44) In the Debug navigator on the left pane of Xcode, it shows the code stopped at: #0 0x000000010515fd44 in _dispatch_assert_queue_fail () This is what shows at the end in the editor window. At the very end is where the error message in the red ribbon shows: 0x10515fd10 <+68>: add x9, x9, #0xf2f ; "BUG IN CLIENT OF LIBDISPATCH: Assertion failed: " 0x10515fd14 <+72>: stp x9, x8, [sp] 0x10515fd18 <+76>: adrp x1, 65 0x10515fd1c <+80>: add x1, x1, #0xefa ; "%sBlock was %sexpected to execute on queue [%s (%p)]" 0x10515fd20 <+84>: sub x0, x29, #0x18 0x10515fd24 <+88>: bl 0x10519cfc8 ; symbol stub for: asprintf 0x10515fd28 <+92>: ldur x19, [x29, #-0x18] 0x10515fd2c <+96>: str x19, [sp] 0x10515fd30 <+100>: adrp x0, 65 0x10515fd34 <+104>: add x0, x0, #0xf65 ; "%s" 0x10515fd38 <+108>: bl 0x1051986b0 ; _dispatch_log 0x10515fd3c <+112>: adrp x8, 98 0x10515fd40 <+116>: str x19, [x8, #0x268] -> 0x10515fd44 <+120>: brk #0x1 I have no idea which code is causing the error, so I don't even know what code to put in my question. I created a symbolic breakpoint with 'LayoutConstraints' in the Symbol field. It is never tripped. I get no purple warnings that says a line of code should not be in the main thread. I have no idea where to go from here. I don't ind anything when I do a search in the internet that is narrowed down to address my error. I am running the code on an iPhone 13 Pro Max device with iOS 16.5. I am using Xcode 14.3 on a Mac Pro running Ventura 13.4
3
2
1.6k
Aug ’24
EKEventStoreChanged
I'm trying to enable my app to receive a notification each time the event store changes.The documentation for EKEventStore at https://developer.apple.com/reference/eventkit/ekeventstore shows the following:static let EKEventStoreChanged: NSNotification.NameWhat does that mean? How do I use that information?
2
0
1.2k
Feb ’22