I want to debug my QuickLook extension for macOS. I read somewhere online that when running it in Xcode, I have to select Quick Look Simulator, but I have no idea what to do after that, and I couldn't find any official documentation.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
When evaluating some variables holding an optional value in the debugger with e variable, Xcode prints something like (Bool?) $R3 = nil. This gives the impression that the value is nil (what else should it mean?) and hovering that variable in the code editor also shows a popover with the content nil, but evaluating e variable?.description shows that it holds some value, for example (String?) $R4 = "false" (as a validation, the command e variable == false prints (Bool) $R6 = true.
I submitted a bug report on November 2019, more than 2 years ago, and it never got any response. Is it possible that this is the expected behavior? Why can nobody fix it? I'm constantly wasting time because of this bug that causes me to make wrong assumptions during debugging.
When Xcode shows a warning to update the project settings, it wants to set the deployment target of every target to RECOMMENDED_MACOSX_DEPLOYMENT_TARGET, which seems to be 10.14.6. Why is this value recommended, when the minimum supported version ist 10.13, which has just been raised from 10.10 with Xcode 14?
Since NSPathControl.setPathComponentCells(_:) and .clickedPathComponentCell() are deprecated, I'm trying to use pathItems and clickedPathItem instead. Since I'm representing a virtual path, I cannot use the NSPathControl.url setter, but instead set pathItems directly.
The problem is that in the action method it doesn't seem possible to get the index of the clicked path item, nor does it seem possible to associate any kind of data with each path item, since when the action method is called, the actual object instances stored in pathItems and also the one returned by clickedPathItem change every time.
Here is the sample code that reproduces the issue:
class ViewController: NSViewController {
@IBOutlet weak var pathControl: NSPathControl!
override func viewDidLoad() {
super.viewDidLoad()
pathControl.pathItems = ["a", "b", "c"].map({ title in
let item = NSPathControlItem()
item.title = title
return item
})
}
@IBAction func selectPath(_ sender: NSPathControl) {
print(sender.clickedPathItem!.description, sender.clickedPathItem!.title, sender.pathItems.description)
}
}
Here is a sample output (notice how the printed addresses change every time):
<NSPathControlItem: 0x6000012780a0> a [<NSPathControlItem: 0x6000012780a0>, <NSPathControlItem: 0x600001278020>, <NSPathControlItem: 0x600001278090>]
<NSPathControlItem: 0x600001278070> a [<NSPathControlItem: 0x600001278070>, <NSPathControlItem: 0x600001278140>, <NSPathControlItem: 0x6000012780d0>]
<NSPathControlItem: 0x60000124c030> a [<NSPathControlItem: 0x60000124c030>, <NSPathControlItem: 0x60000124c080>, <NSPathControlItem: 0x60000124c070>]
I would like to install macOS 14 Sonoma on an external partition, but I couldn't find an installer on the developer website. It seems that it's only possible to upgrade from the System Settings, so I thought I would install Ventura first on the separate partition and then upgrade to Sonoma.
I downloaded the Ventura installer from the App Store and selected the external partition during the installation, but when the Mac reboots, it just reboots into my main macOS partition. If I shut down and hold the power button pressed to select the boot partition (I have a M1 MacBook Pro 14" 2022), then nothing happens: an indeterminate progress indicator spins for a couple seconds, the partition list remains there and I can only successfully boot into my main partition again. I also tried running the installer from another macOS Ventura and macOS Monterey partition I had installed last year, but when I select the partition on which to install the new Ventura, nothing happens and I can only quit the installer.
Is there a way to debug all these issues? How can I install macOS Sonoma on a separate partition without overwriting my main macOS Ventura install?
Before updating to macOS 15 Sequoia, I used to be able to create file bookmarks with this code:
let openPanel = NSOpenPanel()
openPanel.runModal()
let url = openPanel.urls[0]
do {
let _ = try url.bookmarkData(options: [.withSecurityScope])
} catch {
print(error)
}
Now I get an error
Error Domain=NSCocoaErrorDomain Code=256 "Failed to retrieve app-scope key"
These are the entitlements:
com.apple.security.app-sandbox
com.apple.security.files.user-selected.read-write
com.apple.security.files.bookmarks.app-scope
Strangely, my own apps continued working, after updating to macOS 15 some days ago, until a few moments ago. Then it seems that all of a sudden my existing bookmarks couldn't be resolved anymore, and no new bookmarks could be created. What could be the problem?
After building the Product Archive, the Organizer window opens, I click Distribute App. Next. Next. Next. Next. Crash. The crash happens before I'm able to export anything, so I cannot even use the Application Loader. The last message above the indeterminate progress indicator I can read before it crashes is "Packaging MyApp ...".
It would be really nice if an Apple engineer could help sort this out, because I already contacted the App Store Connect support and they told me that the only way I can get help is by writing on this forum, searching the Xcode documentation, or using one of the 2 free TSIs I get each year (which I have already used).
Stacktrace (I tried to paste the whole crash report, but I get an error that the message is too long and that I should click on the icon to attach a file instead, but I don't see such an icon):
Process:							 Xcode [834]
Path:									/Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:						com.apple.dt.Xcode
Version:							 12.2 (17535)
Build Info:						IDEFrameworks-17535000000000000~23 (12B45b)
App Item ID:					 497799835
App External ID:			 838360538
Code Type:						 X86-64 (Native)
Parent Process:				??? [1]
Responsible:					 Xcode [834]
User ID:							 501
Date/Time:						 2020-12-07 17:22:11.231 +0100
OS Version:						macOS 11.0.1 (20B29)
Report Version:				12
Bridge OS Version:		 3.0 (14Y908)
Anonymous UUID:				7A3F67B1-D68A-4230-40B2-B7EE13B51792
Sleep/Wake UUID:			 4913FE52-7DB5-45E0-9396-EFBA2ADD0B5C
Time Awake Since Boot: 47000 seconds
Time Since Wake:			 5900 seconds
System Integrity Protection: enabled
Crashed Thread:				17	Dispatch queue: ConcurrentQueue: -[IDEDistributionPackagingStepViewController viewDidInstall]_block_invoke
Exception Type:				EXC_CRASH (SIGABRT)
Exception Codes:			 0x0000000000000000, 0x0000000000000000
Exception Note:				EXC_CORPSE_NOTIFY
Application Specific Information:
Possibly stale failure hints from 2020-12-07 16:21:03 +0000:
	0: Calling block provided by:
	0	 DVTDispatchAsync (in DVTFoundation)
	1	 __56-[IDEArchiveProductSource updateArchivesWithCompletion:]_block_invoke_2 (in IDEProducts)
	2	 DVT_CALLING_CLIENT_BLOCK (in DVTFoundation)
	3	 __DVTDispatchAsync_block_invoke (in DVTFoundation)
	4	 _dispatch_call_block_and_release (in libdispatch.dylib)
	5	 _dispatch_client_callout (in libdispatch.dylib)
	6	 _dispatch_continuation_pop (in libdispatch.dylib)
	7	 _dispatch_async_redirect_invoke (in libdispatch.dylib)
	8	 _dispatch_root_queue_drain (in libdispatch.dylib)
	9	 _dispatch_worker_thread2 (in libdispatch.dylib)
10	 _pthread_wqthread (in libsystem_pthread.dylib)
11	 start_wqthread (in libsystem_pthread.dylib)
ProductBuildVersion: 12B45b
ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-17518/DVTFoundation/FilePaths/DVTFilePath.m:912
Details:	url should be an instance inheriting from NSURL, but it is nil
Object:	 <DVTFilePath>
Method:	 +filePathForFileURL:
Thread:	 <NSThread: 0x7fa6c43458e0>{number = 4468, name = (null)}
Open FDs: 115/7168
Hints:	
	0: Calling block provided by:
	0	 DVTDispatchAsync (in DVTFoundation)
	1	 DVTAsyncPerformBlock (in DVTFoundation)
	2	 -[IDEDistributionPackagingStepViewController viewDidInstall] (in IDEKit)
	3	 -[DVTViewController _viewDidInstall] (in DVTViewControllerKit)
	4	 -[_DVTViewController_ViewLifecycleInterpositions viewDidMoveToWindow] (in DVTViewControllerKit)
	5	 -[NSView _setWindow:] (in AppKit)
	6	 -[NSView addSubview:] (in AppKit)
	7	 -[NSView setSubviews:] (in AppKit)
	8	 -[DVTBorderedView setContentView:] (in DVTUserInterfaceKit)
	9	 -[IDEDistributionAssistantWindowController setDistributionStepViewController:] (in IDEKit)
10	 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:] (in Foundation)
11	 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] (in Foundation)
12	 _NSSetObjectValueAndNotify (in Foundation)
13	 -[IDEDistributionAssistantWindowController next:] (in IDEKit)
14	 __79-[IDEDistributionAutomaticSigningAssetsStepViewController _locateSigningAssets]_block_invoke_2 (in IDEKit)
15	 DVT_CALLING_CLIENT_BLOCK (in DVTFoundation)
16	 ___DVTAsyncPerformBlockOnMainRunLoop_block_invoke (in DVTFoundation)
17	 CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK (in CoreFoundation)
18	 __CFRunLoopDoBlocks (in CoreFoundation)
19	 __CFRunLoopRun (in CoreFoundation)
20	 CFRunLoopRunSpecific (in CoreFoundation)
21	 RunCurrentEventLoopInMode (in HIToolbox)
22	 ReceiveNextEventCommon (in HIToolbox)
23	 _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox)
24	 _DPSNextEvent (in AppKit)
25	 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (in AppKit)
26	 -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit)
27	 -[NSApplication run] (in AppKit)
28	 NSApplicationMain (in AppKit)
29	 start (in libdyld.dylib)
Backtrace:
	0	 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit)
	1	 _DVTAssertionHandler (in DVTFoundation)
	2	 _DVTAssertionFailureHandler (in DVTFoundation)
	3	 +[DVTFilePath filePathForFileURL:] (in DVTFoundation)
	4	 -[IDEDistributionSymbolsStep runWithError:] (in IDEFoundation)
	5	 -[IDEDistributionProcessingPipeline process:] (in IDEFoundation)
	6	 -[IDEDistributionPackagingStepViewController _runPipeline] (in IDEKit)
	7	 __60-[IDEDistributionPackagingStepViewController viewDidInstall]_block_invoke_2 (in IDEKit)
	8	 DVT_CALLING_CLIENT_BLOCK (in DVTFoundation)
	9	 __DVTDispatchAsync_block_invoke (in DVTFoundation)
10	 _dispatch_call_block_and_release (in libdispatch.dylib)
11	 _dispatch_client_callout (in libdispatch.dylib)
12	 _dispatch_continuation_pop (in libdispatch.dylib)
13	 _dispatch_async_redirect_invoke (in libdispatch.dylib)
14	 _dispatch_root_queue_drain (in libdispatch.dylib)
15	 _dispatch_worker_thread2 (in libdispatch.dylib)
16	 _pthread_wqthread (in libsystem_pthread.dylib)
17	 start_wqthread (in libsystem_pthread.dylib)
abort() called
Application Specific Signatures:
(url) != nil
...