Category: Objective-C

Improving Sync in Portfolio

Sync is one of the notoriously hard problems in computing. There are all kinds of edge cases that have to be accounted for lest they throw the data into an ambiguous state. It comes in multiple flavors and with a variety of needs, but all of them eventually boil down to one goal: ensuring the local copy of the data…

CocoaPods: The Elegant Solution To Installing The Same Pod In Multiple Targets →

The Elegant Solution So I went to straight to the expert – Core Contributor to CocoaPods @NeoNacho, who pointed me to the following elegant solution: # Podfile platform :ios, '9.0' use_frameworks! # My other pods def testing_pods pod 'Quick', '0.5.0' pod 'Nimble', '2.0.0-rc.1' end target 'MyTests' do testing_pods end target 'MyUITests' do testing_pods end

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…

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…

Five Years on the App Store

I have always enjoyed reading real accounts from developers on the App Store. As Portfolio turns five years old this August, I figured it was my turn to do the same. Enjoy! Numbers Portfolio sold its first copy on August 16, 2010. In the five years since it has been sold 37,805 copies for a net to me of $364,797.…

Why I’m Waiting on Swift

The promise of Swift looks great. Faster performance1, better error handling, and better compile-time bug detection sound like very welcome additions to the iOS/OS X development ecosystem. The thing is, though, there are problems, problems that make it impractical to put time into mastering the language. Swift is being actively developed as a language, so much so that Apple is…