I signed out of iCloud in the iPhone 8 Simulator, and it has shown the screen saying "Removing iCloud data..." showing that it's working for a few hours now. When it did this before, I shut down the Simulator and when I opened the Simulator again, it shows that it never logged out of iCloud.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I am having trouble creating a sandbox tester account in App Store. I keep getting an error message saying there are one or more validation errors when I click on "Invite", but there are no indications of any errors. None of the fields are marked with red for an error.What is going on? Is there a limit of the number of sandbox tester accounts I can create? Is anyone else having trouble with this?
Anyone know where I can get a list of all the UserDefaults keys? I can't find it in documentation.
How do I copy to file system or play with AVAudioPlayer an MPMediaItem that I get from an MPMediaPickerController initialized with type audio? When I try, I get an error that says:The file “item.mp3” couldn’t be opened because URL type ipod-library isn’t supported.
What does that mean in Xcode When the name of a swift file that is showing in the tab at the top in the editor window is italicized?
I'm curious why I don't see posts about Xcode crashing. Since I updated both macOS Monterey 12.6 and Xcode 14, Xcode repeatedly crashes, becoming more frequently, even within 20 seconds between the last two crashes.
Am I the only one getting these crashes?
I am preparing to submit an app for the very first time.Why is the default version number 1.0? Doesn't that 0 get truncated? Would it be better if I changed the version number to 1? Would it make a difference?
What are guidelines for numbering the build number? Should it just start with 0 and increment by one each time I archive a project for distribution?
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?
When I go to the Shortcuts app and add an action, there is a tab that lets me see Apps that has actions I can use. How do I make my iOS app be able to contribute actions for users to use in a shortcut, so that a user creating a shortcut can add an action that does something in my app?
An example of this is the Walmart app. A user can create use an action that allows him to check in.
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
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.
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags:
CloudKit
Background Tasks
User Notifications
What is createdUserRecordName record type metadata used for?
I can't find any information on it. I see it in CloudKit dashboard for every record type.
Is there a way to use code pin iOS to pin a message to the top in the Messages app?
Why did I get an error in playground in debug window for this code?
print("// MARK: - Start execable code here...")
do {
let store = CNContactStore()
if try await store.requestAccess(for: .contacts) {
// Do something with Contacts.
let phoneNumber = CNPhoneNumber(stringValue: "903-276-1046")
let predicateForContactsMatchingPhoneNumber = CNContact.predicateForContacts(matching: phoneNumber)
let contactFetchRequest = CNContactFetchRequest(keysToFetch: thoroughKeysToCompare)
contactFetchRequest.predicate = predicateForContactsMatchingPhoneNumber
contactFetchRequest.unifyResults = true
var contactOfMe: CNContact! = nil
try! store.enumerateContacts(with: contactFetchRequest) {
contact, stop in
contactOfMe = contact
stop.pointee = true
}
let contact = Contact(cnContact: contactOfMe)
for property in contact.enumerated() {
print("- \(property)")
}
} else {
// Handle if Contacts access is denied.
fatalError()
}
} catch {
// Handle any error.
print("error requesting access: \(error.localizedDescription)")
}
Debug window:
// MARK: - Start execable code here...
Playground execution failed:
error: Execution was interrupted, reason: shared-library-event.
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
* thread #1, queue = 'com.apple.main-thread'
frame #0: 0x00007ff80002f931 libobjc.A.dylib`_mapStrHash(_NXMapTable*, void const*) + 73
frame #1: 0x00007ff80002fc7f libobjc.A.dylib`_NXMapMember(_NXMapTable*, void const*, void**) + 35
frame #2: 0x00007ff80003b7ae libobjc.A.dylib`getProtocol(char const*) + 41
frame #3: 0x00007ff8000428e6 libobjc.A.dylib`class_conformsToProtocol + 337
frame #4: 0x00007ff80004ab4e libobjc.A.dylib`-[NSObject conformsToProtocol:] + 47
frame #5: 0x0000000109c27951 UIKitCore`_UIFocusItemContainerIsScrollableContainer + 74
frame #6: 0x0000000109c28e38 UIKitCore`-[_UIFocusEnvironmentContainerTuple initWithOwningEnvironment:itemContainer:] + 194
frame #7: 0x0000000109c28fed UIKitCore`+[_UIFocusEnvironmentContainerTuple tupleWithOwningEnvironment:itemContainer:] + 70
frame #8: 0x0000000109c4f41e UIKitCore`_UIFocusRegionContainerFromEnvironmentAndContainer + 44
frame #9: 0x0000000109c27ed3 UIKitCore`_UIFocusItemContainerAddChildItemsInContextWithArguments + 1162
frame #10: 0x000000010a99c439 UIKitCore`-[UIView _searchForFocusRegionsInContext:] + 962
frame #11: 0x0000000109c6b37f UIKitCore`-[_UIFocusMapSnapshot addRegionsInContainer:] + 4583
frame #12: 0x0000000109c69740 UIKitCore`-[_UIFocusMapSnapshot _capture] + 456
frame #13: 0x0000000109c67fc5 UIKitCore`-[_UIFocusMapSnapshot _initWithSnapshotter:mapArea:searchArea:] + 628
frame #14: 0x0000000109c6cce2 UIKitCore`-[_UIFocusMapSnapshotter captureSnapshot] + 227
frame #15: 0x0000000109c5f450 UIKitCore`-[_UIFocusMap _inferredDefaultFocusItemInEnvironment:] + 147
frame #16: 0x0000000109c2b1cf UIKitCore`-[_UIFocusEnvironmentPreferenceEnumerationContext _inferPreferencesForEnvironment:] + 157
frame #17: 0x0000000109c2abbc UIKitCore`-[_UIFocusEnvironmentPreferenceEnumerationContext _resolvePreferredFocusEnvironments] + 118
frame #18: 0x0000000109c2ab12 UIKitCore`-[_UIFocusEnvironmentPreferenceEnumerationContext prefersNothingFocused] + 31
frame #19: 0x0000000109c2beeb UIKitCore`_enumeratePreferredFocusEnvironments + 198
frame #20: 0x0000000109c2c061 UIKitCore`_enumeratePreferredFocusEnvironments + 572
frame #21: 0x0000000109c2c061 UIKitCore`_enumeratePreferredFocusEnvironments + 572
frame #22: 0x0000000109c2c061 UIKitCore`_enumeratePreferredFocusEnvironments + 572
frame #23: 0x0000000109c2bd11 UIKitCore`-[_UIFocusEnvironmentPreferenceEnumerator enumeratePreferencesForEnvironment:usingBlock:] + 230
frame #24: 0x0000000109c2c747 UIKitCore`-[_UIDeepestPreferredEnvironmentSearch deepestPreferredFocusableItemForEnvironment:withRequest:] + 817
frame #25: 0x0000000109c95837 UIKitCore`-[UIFocusUpdateContext _updateDestinationItemIfNeeded] + 265
frame #26: 0x0000000109c95627 UIKitCore`-[UIFocusUpdateContext _destinationItemInfo] + 22
frame #27: 0x0000000109c95535 UIKitCore`-[UIFocusUpdateContext nextFocusedItem] + 24
frame #28: 0x0000000109c71ea6 UIKitCore`-[UIFocusSystem updateFocusIfNeeded] + 1347
frame #29: 0x0000000109c7608c UIKitCore`__43-[UIFocusSystem _updateFocusUpdateThrottle]_block_invoke + 34
frame #30: 0x000000010a94b971 UIKitCore`-[_UIAfterCACommitBlock run] + 57
frame #31: 0x000000010a94be71 UIKitCore`-[_UIAfterCACommitQueue flush] + 191
frame #32: 0x000000010a3926eb UIKitCore`_runAfterCACommitDeferredBlocks + 782
frame #33: 0x000000010a380fa2 UIKitCore`_cleanUpAfterCAFlushAndRunDeferredBlocks + 96
frame #34: 0x000000010a3b6be1 UIKitCore`_afterCACommitHandler + 58
frame #35: 0x00007ff8003b1c12 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
frame #36: 0x00007ff8003ac57f CoreFoundation`__CFRunLoopDoObservers + 515
frame #37: 0x00007ff8003acaa2 CoreFoundation`__CFRunLoopRun + 1121
frame #38: 0x00007ff8003ac264 CoreFoundation`CFRunLoopRunSpecific + 560
frame #39: 0x00007ff8003ad234 CoreFoundation`CFRunLoopRun + 40
frame #40: 0x00007ff83755a4e3 libswift_Concurrency.dylib`swift_task_asyncMainDrainQueueImpl() + 35
frame #41: 0x00007ff83755a4b4 libswift_Concurrency.dylib`swift_task_asyncMainDrainQueue + 52
frame #42: 0x00000001015d409f $__lldb_expr32`main at <unknown>:0
frame #43: 0x0000000100e25560 EnumeratedContactsCNContact`linkResources + 256
frame #44: 0x00007ff8003b2986 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
frame #45: 0x00007ff8003b2148 CoreFoundation`__CFRunLoopDoBlocks + 399
frame #46: 0x00007ff8003ace09 CoreFoundation`__CFRunLoopRun + 1992
frame #47: 0x00007ff8003ac264 CoreFoundation`CFRunLoopRunSpecific + 560
frame #48: 0x00007ff809b4024e GraphicsServices`GSEventRunModal + 139
frame #49: 0x000000010a3827bf UIKitCore`-[UIApplication _run] + 994
frame #50: 0x000000010a3875de UIKitCore`UIApplicationMain + 123
* frame #51: 0x0000000100e256c5 EnumeratedContactsCNContact`main + 357
frame #52: 0x0000000100fbb384 dyld_sim`start_sim + 10
frame #53: 0x000000010943341f dyld`start + 1903```
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Tags:
Swift Playground
Debugging
Contacts
LLDB