Things I Have Learnt This Week (49)

Embedded Binaries, no WiFi and AppKit
2019-12-09

Embedding Binaries in MacOS Apps.

Don’t tick the sign on embed box when embedding binaries in a sandboxed application. You’ll get an annoying error message when using it from NSTask, or Process in swift. I’m not entirely sure that I’ve enacted the correct magic incantations to pass app review - but who says this app will ever make it to the App Store.

NSPopover

Using NSPopover don’t init the popover directly, rather use the presenting view controllers method func present(_ viewController: NSViewController, asPopoverRelativeTo positioningRect: NSRect, of positioningView: NSView, preferredEdge: NSRectEdge, behaviour: NSPopover.Behavior) This gives you the dismiss with escape for free.

macOS Networking

If you’re on a WiFi connection that isn’t connected to the internet - all sorts of funky stuff happens on macOS Catalina. Applications take forever to open, Simulator doesn’t work full stop - launchd failed to open simulator. Does simulator really need an internet connection to open?