Posts

Post not yet marked as solved
1 Replies
643 Views
Starting from Xcode 12.4 (I think), failing unit tests in framework targets take about 5 seconds to complete. Successful tests complete almost instantly (as expected). For example, the following test:     func testExampleFailure() {         XCTFail()     } Takes 4.356 seconds to execute on my 2019 MacBook Pro: Test Case '-[FrameworkTests.FrameworkTests testExampleFailure]' failed (4.356 seconds). This seems to only affect unit tests in Framework targets (unit tests for App targets are unaffected). I have also tested this in fresh Framework template projects across multiple Macs, so it appears to be an Xcode bug. I'd hoped Xcode 13 would fix this issue, but it persists for me on Monterey. Perhaps someone could suggest a workaround?
Posted
by Lemontine.
Last updated
.
Post not yet marked as solved
7 Replies
1.2k Views
Yesterday I installed the Catalina Beta 7 on an external HD that I use for photo storage as well. My photos were in a folder called Photos at the root of the hard drive. After upgrading the HD from Mojave (which I had already installed on the drive) to Catalina, I noticed that the entire photos folder (about 1TB of data) was missing.Finder still shows my external drive as having 1 TB used, so I'm assuming my files are somewhere, but I can't find them.I found in the release notes for Beta 1 (I installed Beta 7), this message:"During upgrades to macOS 10.15, files and folders stored at the root-level of a volume are moved aside to /Library/SystemMigration/History/Migration-UUID/QuarantineRoot/."However there is only a 59 KB file "Request" in that folder. It sounds like root level files are not safe during installation of Catalina, which is probably an issue for others installing on an externa drive that's also used for storage.Any suggestions for recovering my precious photos?
Posted
by Lemontine.
Last updated
.
Post not yet marked as solved
4 Replies
928 Views
I include a faceless helper app inside my main app's bundle (inside the SharedSupport directory). The first time I go to launch it using NSWorkspace, the system presents a dialog:"You are opening the application “HelperApp” for the first time. Are you sure you want to open this application?The application is in a folder named “SharedSupport”. To see the application in the Finder without opening it, click Show Application."The user can choose cancel and the helper will not be launched. This is a bit annoying and confusing for the user, and a bit of an implementation leak. Is there any way I can include a permission in the entitlements for my main app, or some other way to bypass the dialog?
Posted
by Lemontine.
Last updated
.
Post not yet marked as solved
15 Replies
662 Views
My Mac app produces mini Mac apps configured for a particular purpose. Panic's Transmit does something similar with "droplets". These little .app bundles are generated at runtime, and each embeds a unique file specified by the user in its Resources folder. I would like the scaffold for these mini apps to use the App Sandbox (there's no reason not to, as they only access a single file from within their own bundles). However, I can't code-sign the scaffold when building it from Xcode, as embedding a new resouce later will void the code signature (and then Gatekeeper will reject it, if it ever ends up in quarantine). Is there a correct way to do something like this? The mini apps are not notarized or DeveloperID signed (that's fine, users can open them with control-clicking-open), but I would like to maximize security if at all possible, and use the sandbox.
Posted
by Lemontine.
Last updated
.
Post not yet marked as solved
0 Replies
881 Views
I'm writing an AppKit app which needs to send HTML email. Unfortuantely there is no API in AppKit for doing so. There is however MFMessageComposeViewController in iOS/Catalyst.The approach I have been using is to embed a "Mail Assistant" Catalyst helper app inside my main AppKit app's bundle. The main app launches this helper app when it needs to send HTML email. It has been working great.(this approach was inspired by Drafts: https://docs.getdrafts.com/misc/mail-assistant)Unfortunately, Xcode 11.4 does not seem to like Catalyst helper apps being inside the bundle of AppKit apps. When building using 11.4, I get the following error:"Target Integrity: Building for macOS, but the embedded app 'Mail Assistant.app' was built for Mac Catalyst.I can't see any real problem fundamentally with my approach, yet it seems Apple has decided to prevent this kind of AppKit-Catalyst cooperation.Can anyone think of a workaround, or will I be forced to remove the HTML mail sending feature from my AppKit app?
Posted
by Lemontine.
Last updated
.
Post marked as solved
1 Replies
800 Views
I'm encountering run issues when running my os_signpost instrument that spits out the following kind of messages:"Data stream: 5 log/signpost messages lost due to high rates in live mode recording. Try windowed recording mode."I am using deferred recording already (enabled from the checkbox in the recording preferences), but I can't find a setting for a "windowed recording mode" anywhere.Would appreciate a point in the right direction!
Posted
by Lemontine.
Last updated
.
Post not yet marked as solved
2 Replies
761 Views
I'm trying to get a similar look to the sidebar table view in redesigned Mac App Store app on 10.14. That nice sidebar seems to have the standard source list appearance (with vibrancy), but unlike regular table views, a selected row has a neutral colored vibrant selection, rather than coloring the row's background with the system control accent color.Can anyone give a suggestion on how to get this behaviour?Thanks very much.
Posted
by Lemontine.
Last updated
.
Post marked as solved
3 Replies
739 Views
I have an NSTextView subclass, and I'm overriding the NSResponder declared method cancelOperation(_:) to handle the escape key.Sometimes I want to consume the event, and othertimes I'd like to pass the method onto the next responder in the chain (and let it bubble up to the content view controller of the window).My understanding was I do this by simply calling super.cancelOperation(sender), but this causes an "unrecognized selector sent to instance" exception. NSTextView doesn't respond to cancelOperation.What's the right way to let the event continue up the responder chain?
Posted
by Lemontine.
Last updated
.
Post not yet marked as solved
1 Replies
817 Views
I'd like to create a spotlight importer to make the contents of my Mac app's JSON based documents visible to spotlight.https://developer.apple.com/library/archive/documentation/Carbon/Conceptual/MDImporters/Concepts/WritingAnImp.html#//apple_ref/doc/uid/TP40001275-CJBEJBHHThe instructions on building a Spotlight importer indicate that "Xcode provides a project template", however it seems to be missing from Xcode 10. Can someone help me with a sample project?
Posted
by Lemontine.
Last updated
.
Post not yet marked as solved
2 Replies
504 Views
I'd like to build some workflows in Automator (.workflow files), and ship them along with my Mac App Store app.Workflow files stored in ~/Library/Services are automatically picked up by the system as services. Is there any way to have the system recognise services inside my app bundle?Or would I need to request a temporary entitlement to move .services from inside my bundle to that folder?
Posted
by Lemontine.
Last updated
.
Post not yet marked as solved
0 Replies
400 Views
I'd like to build a smart NSTextView, with various "smart" editing features like automatic closing bracket insertion.What's the correct way to go about modiying an NSTextStorage in response to a user action while maintaining a logical undo stack in the NSUndoManager?Undo should revert back to the state of the text storage before the user made their change, including any additional "smart" changes that came after it.
Posted
by Lemontine.
Last updated
.
Post not yet marked as solved
3 Replies
646 Views
When overriding readFromPasteboard and writeToPasteboard in an NSTextView, I need to check if the pasteboard's type is plain text.NSTextView seems to be using NSPasteboard.PasteboardType(rawValue:"NSStringPboardType") as the plain text pasteboard type. The symbol NSStringPboardType is not available in Swift 4.2. Xcode 10 suggests NSPasteboard.PasteboardType.string instead, but it's not equal to NSStringPboardType, and has a raw value of 'public.utf8-plain-text'.Is there a way to reference NSStringPboardType in Swift without using a hard coded string?
Posted
by Lemontine.
Last updated
.
Post not yet marked as solved
2 Replies
1.7k Views
I have a file based iOS app and I'm using a UIActivityViewController to present various activities, like printing and copying the file as plain text.An "Add People" button has started appearing in the share sheet. When I tap it, my app crashes: *** Assertion failure in -[_UICloudSharingActivity performActivity], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3698.54.4/_UICloudSharingActivity.m:195*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Should never be called'I'd like to supress this button, but I can't find the correct key to assign to UIActivityViewController's excludedActivityTypes. None of the UIActivityType's listed in the header correspond to sharing with other people.Alternatively, I could just implement whatever is necessary for this to work, but I can't find it documented anywhere what this button even actually does, or what is required of me to make it work.
Posted
by Lemontine.
Last updated
.
Post not yet marked as solved
3 Replies
814 Views
I have an NSTextField and an NSTextView. I'd like them to have them render a wrapped string with exactly the same frame. I'm going to be using the NSTextField as a temporary overlay view ontop of the NSTextView, and I don't want the user to notice.Even though both views use the same NSAttributedString, with the same NSParagraphStyle, the NSTextField subclass puts more spacing between lines than the NSTextView.Is there some property other than the line spacing/paragraph spacing attributes paragraph style that would affect the way NSTextView or NSTextField layout wrapped lines?Thanks a bundle.
Posted
by Lemontine.
Last updated
.