Category: OS X

BitBar →

Useful little utility for providing quick access to arbitrary functionality. Put the output from any script or program in your Mac OS X Menu Bar

Things Not Allowed in the Mac App Store: Interacting with Finder via AppleScript

A recent client project (an OS X app) had some functionality that included acquiring the path to the frontmost Finder window. The only way to get that path is via AppleScript: tell application “Finder” set frontpath to POSIX path of (target of window 1 as alias) end tell Using AppleScript in a sandboxed app requires an entitlement. The official one…

NSUserDefaults Stops Functioning

While working on a project for a client (updating an OS X app), we ran into a problem that we first thought was a bug in the app itself. Entire portions of the interface were completely non-functional but only on the client’s machine. I inherited large portions of technical debt with the project, so I figured it was just something…

Swift Namespacing and Sharing Code

In the old days of iOS and OS X development, “namespacing” meant prepending Objective-C class names with a (hopefully) unique prefix to avoid conflicts. Swift mostly removes this need by providing automatic namespacing at the module level, though this can introduce an additional consideration. Recently I began adding a Today Widget to an iOS app and ran into an odd…

Estimating Complexity in App Development

As the App Store has matured and its revenue streams diminished, I have needed to pursue consulting jobs to bolster my income. Unlike working fully for myself, clients want (quite reasonably) an estimate of what a job is going to cost before signing off to begin the work. Unfortunately, in software development, accurate estimates are notoriously the hardest things to…

App Sandboxing Incompatibilities: Authorization Services

I’m currently working on a consulting job for a Mac OS X app. Since this app is distributed on the Mac App Store, it needs to adhere to the App Sandboxing requirement. One of the enhancements on the to-do list is a feature where system administrators can lock down the editing portions of the app, leaving normal users with only…

Leaving the Mac App Store →

There are a number of reasons for Sketch leaving the Mac App Store—many of which in isolation wouldn’t cause us huge concern. However as with all gripes, when compounded they make it hard to justify staying: App Review continues to take at least a week, there are technical limitations imposed by the Mac App Store guidelines (sandboxing and so on)…

Modern Login Items →

Login Items have previously been a way for OS X apps to provide this service to users, but is not compatible with the sandbox requirements of the Mac App Store. Fortunately, there is a much more modern way to handle this, and I’ll walk you through setting it up in your own projects.

How to Write a Support Request →

I’ve definitely received a variety of support requests over the years. Brett sums up very well how to get the best results when you’re having a problem. You’re the customer, and you deserve good support. Not following these guidelines should never prevent excellent customer service, but taking them into account when submitting a problem or request will make the experience…

Updating for App Transport Security

iOS 9 and tvOS both brought with them a new addition called App Transport Security. In short, it means that, in an effort to encourage wider use of https, vanilla http connections will be prevented from connecting unless an exception exists in the app’s Info.plist. Both Portfolio and Studio Pro provide a companion Mac-based loading app. It provides a RESTful…

Correctly Drawing PDFs in Cocoa

Nearly every example available online for rasterizing a PDF document into an image on iOS or OS X is wrong. Most of those take this approach: //Document Loading CGPDFDocumentRef pdfDocument = CGPDFDocumentCreateWithURL(#URL#); CGPDFPageRef page = CGPDFDocumentGetPage(pdfDocument, 1); //Sizing CGRect mediaBox = CGPDFPageGetBoxRect(page, kCGPDFMediaBox); size_t width = (size_t) CGRectGetWidth(mediaBox); size_t height = (size_t) CGRectGetHeight(mediaBox); size_t bytesPerRow = ((width * 4) +…

An Objective-C Reporting Framework

Studio Pro has the capability of generating a paginated invoice, complete with all of the traditional invoice components. Recently, as the first of some new reporting options, I wanted to add the ability to generate an order summary separate from the invoice to make fulfillment easier. Problem is, the invoice generation code is very specific and not at all suited…