May 2013
1 post
7 tags
wopen 0.2
I’ve updated my wopen bash function to open the .xcodeproj file if no .xcworkspace is available. Copy the alias from here https://gist.github.com/coryalder/5609996 Place in your .bash_profile or .bashrc file (~/.bash_profile). Example usage: cd projectdirectory wopen issues open projectdirectory.xcworkspace if that file exists, or open projectdirectory.xcodeproj if that file exists,...
May 20th
February 2013
1 post
5 tags
PhotoDog
My new app PhotoDog was approved late last night! I’ve spent much of the day sending out press releases, and organizing my social media presence (Instagram and Twitter accounts, mostly). I won’t write much about that here, as this blog is mostly for technical details, but one thing I’ve very proud of is that this marks the first production app that uses my UIActivity for...
Feb 21st
November 2012
3 posts
5 tags
CocoaPods tip #0912: faster .xcworkspace opening
UPDATE: 0.2 available here http://objectivesea.tumblr.com/post/50874228125/wopen-0-2 My typical CocoaPods workflow: Switch to terminal cd to your project directory Edit Podfile type pod update Quickly Cmd-tab back to Xcode to close the project before CocoaPods rewrites it Type open .xcodeworkspace Resume working The step that trips me up the most of all of these, is ironically step #6....
Nov 23rd
6 tags
Best Practices: UIButtons and their...
Declare the UIButton outlet: @property (weak, nonatomic) IBOutlet UIButton *cancelButton; Declare the action method: -(IBAction)cancelButtonAction:(id)sender; Now when you are writing code you will never confuse the outlet and the action. You will always know what this means: [self cancelButton]; or even worse: self.cancelButton; It’s a simple, easy to remember best practice....
Nov 22nd
1 note
8 tags
AFNetworking - Cancelling operations
I recently ran into trouble trying to cancel operations in AFNetworking. Two issues came up. The first was finding my previous query, to cancel it. The second was receiving some kind of notification that the operation was cancelled. The failure block isn’t fired when operations are cancelled. Since my app uses GET requests, cancelAllHTTPOperationsWithMethod:path: was failing to find my...
Nov 16th
2 notes
October 2012
1 post
5 tags
Get the maximum value in an NSSet using KVC →
You can get the maximum value in an NSSet full of NSNumbers using Key-Value-Coding like so: NSSet *set = [NSSet setWithArray:@[ @1,@2,@3,@4,@5 ]]; NSNumber *maxValue = [set valueForKeyPath:@"@max.self"]; Value of maxValue is now @5. It took me ages to find the correct KVC syntax for this. Source is linked below, and has a bunch of other cool uses of KVC. funwithobjc: (This was prompted...
Oct 29th
7 notes
September 2012
1 post
7 tags
Sep 23rd
9 notes
August 2012
1 post
6 tags
Python syntax checking in BBEdit using Flake8
I adapted jshell’s PyFlake gist (https://gist.github.com/1157742) to work with flake8, and my python setup. Took a bit of tweaking to get the regex right. I’ve bound it to Cmd-Shift-L, and I’ve been using it early and often. Check it out if you’re a BBEdit/Python person: https://gist.github.com/3317713
Aug 10th
July 2012
3 posts
5 tags
Interesting NSURLConnection quirk
You would expect this code always return a response, sometimes return data, and when there was no data, you could look at the response and the error to determine what happened. Not so! The response object is nil if it hits a NSURLErrorUserCancelledAuthentication (-1012). NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; if (!data)...
Jul 25th
2 tags
Addendum (setting up raspberry pi)
This is pretty cool / useful: https://github.com/pabloav/raspi-setup/ if only for https://github.com/pabloav/raspi-setup/blob/master/setup.d/05-airplay
Jul 20th
3 tags
Jul 20th
April 2012
4 posts
4 tags
Thing #244 I don't like about Xcode:
Because the structure of your project is abstracted from the on-disc project structure, I always end up with tidy projects and messy project directories.
Apr 27th
1 tag
Respond to a view controller popping off the stack
I spent quite a bit of time googling this, but couldn’t find a definitive answer. Basically, how do you detect and respond to being popped off a UINavigationController’s stack. viewWillDisappear: and viewDidDisappear: both get called when you’re pushing another view controller on to the stack… which is not what I want. I found lots of misdirection involving...
Apr 24th
2 notes
6 tags
Tip #293 for writing good Objective-C methods:...
Do this: - (id)someObject:(DMSomeObject *)caller didSelectView:(DMObjectView *)view { if (caller != self.keyObject) return nil; ***<LONG METHOD REACTING TO A SELECTED VIEW, RETURNING AN OBJECT*** } Don’t do this: - (id)someObject:(DMSomeObject *)caller didSelectView:(DMObjectView *)view { if (caller == self.keyObject) { ***LONG METHOD REACTING TO A SELECTED VIEW,...
Apr 3rd
1 note
4 tags
Distance function for sqlite3 →
This is amazingly useful.
Apr 3rd
March 2012
0 posts
6 tags
Mar 1st
2 notes
January 2012
2 posts
4 tags
Follow up: App Store Spam
Just a little follow up regarding my post from Dec. 9th regarding the spammy behaviour of one App Store developer App Store Spam - 28 identical apps. It looks like he’s trimmed his armada of white noise apps from ~28 down to 8. I have no idea if this was voluntarily, or if he was forced to remove them by Apple. I haven’t contacted the developer directly because I’m not a damn...
Jan 18th
3 notes
Jan 18th
1 note
December 2011
3 posts
4 tags
“Hi, I have an app that I feel is pretty good, but has a shit name (Saline). I’ve...”
–  unled in response to my previous post I absolutely don’t think that would be spamming the App Store. Even if you keep the old one in for a bit to do a little A/B testing. As long as you drop one after a bit, or differentiate the two apps in some meaningful way (i.e. functionality). ...
Dec 10th
2 notes
7 tags
App Store Spam - 28 identical apps
In August, iOS developer George Talusan put 22 identical copies of the same app in the App Store. That’s 22 times, under 22 different names. When I discovered this, a few months ago, I reported it to Apple immediately. Since then, he has put the same app in another 6 times, with a slightly modified UI. Apple does not seem to have responded. I stumbled on this honeypot of apps while...
Dec 9th
30 notes
6 tags
Compile Calcurse on OS X Lion
Download calcurse-2.9.2. Later versions probably work. Open the Terminal, cd ~/Downloads/calcurse-2.9.2. ./configure CFLAGS="-fnested-functions" make sudo make install Edit: after playing with calcurse for a brief period of time, I’ve moved on to wyrd which seems like a better system. It’s based on a unix app called remind. The only thing that bugs me is that downloading and...
Dec 4th
11 notes
September 2011
4 posts
6 tags
Deretina.py - never worry about Retina graphics...
(or rather, never worry about non-retina graphics again) I’ve devised a system to stop having to fiddle with retina and non-retina graphics when building iOS apps. Only make retina (@2x) graphics assets. Store them all in an “Assets” directory, added to my xcode project as a folder-reference. Add a “Run Script” build step that converts any and all @2x graphics...
Sep 18th
9 notes
3 tags
Screen Rotation on the Mac
John Gruber just posted a story about screen orientation, pointing out that the iPad, while less flexible in some ways, is MORE flexible in this aspect (pun intended). This triggered a memory of reading about software that allowed rotating the screen, but when googling for it I found this: ...
Sep 9th
5 tags
Node.js as an HTTP debug server
A quick node.js script to do simple http debugging. I’m working on a RESTful service, and while I’m stubbing out the client, it’s helping to have a server that’ll echo any requests back to it. This can be quickly modified to respond differently to specific requests. See the commented out block for sending 301 redirects for an example. gist here var http =...
Sep 6th
181 notes
8 tags
Tidy JavaScript in BBEdit
I’ve been poking around BBEdit 10 a bit, but it’s decidedly lacking in native support for things like tidying up javascript. So I added it. It took me a bit of twiddling, so I thought I’d post it here. Grab my fork of jsbeautifier, originally written by Einar Lielmanis. It’s identical to the master branch, except it has a fix for a unicode issue with the text-stream...
Sep 2nd
32 notes
August 2011
2 posts
4 tags
The future of hand-held telephones
I’m just going to go ahead and call it now: Windows Phone 7, iOS, and Android, will all succeed. WP7: Dedication (Microsoft won’t give up like HP). Developer tools (They’re awesome). Android: The linux effect. It’s geeky and hackable. Google is heavy and won’t back down on it. iOS: duh. duh.
Aug 23rd
4 notes
3 tags
Save books out of Safari Books Online
This is hard. I spent way too much time figuring this out, because I was annoyed that a book I bought (Addison-Wesley) was available online for free, except only for 45 days after which payment was required. So I made this hack… probably useful to no one else, but here it is. Requirements: iPad. Safari To Go (the Safari Books Online iPad app). a Mac (could be done on a PC, but...
Aug 17th
38 notes
July 2011
1 post
5 tags
CALayer's drop shadow performance. →
I was having some trouble with lagggggy drop shadows caused by enabling a drop shadow on a UIImageView’s CALayer. This article brought to my attention the useful shouldRasterize property. Problem solved!
Jul 23rd
3 notes
June 2011
1 post
5 tags
The special cruelty of Lodsys
The thing that gets me riled up the most about this lodsys business is that they’re going after the little guys. Look at this comparison: Companies sued by Lodsys: Combay, Iconfactory, Illusion Labs, Shovelmate, Quickoffice, Richard Shinderman, and Wulven Game Studios. Companies making crazy-money off in-app purchase: Zynga, Pocket Gems, Capcom, The Playforge, SEGA, Haypi Co, Z2Live,...
Jun 3rd
1 note
May 2011
2 posts
4 tags
May 17th
1 note
6 tags
May 6th
7 notes
April 2011
10 posts
8 tags
iPhone Property-List Benchmark
Researching the best way to solve a problem, I decided to write a quick benchmark. The issue involves a complex many-levelled hierarchical dictionary (+20k when stored in XML format), and I wanted to know if crawling it looking for specific keys would be too slow to be viable. My test function crawls the dictionary, and looks for keys that exist (4), and some that don’t (6). I repeat the...
Apr 26th
30 notes
5 tags
Stack Overflow - Programming Jargon →
There are some great gems on this stack overflow discussion of programming jargon. e.g. Ninja Comments and Scar Tissue, both great terms.
Apr 22nd
4 notes
5 tags
FileMaker PHP Re-Deployment
Threw about three hours of work into a weird bug in FileMaker Pro Server 11. Basically the network administrator cloned the server’s drive, and put that in a different machine. Pull the old server out, pop the new machine with the cloned drive in it’s place… everything works fine except my php-filemaker solution. Spent about three hours looking for the issue. In the end what...
Apr 19th
3 notes
5 tags
Apr 18th
26 notes
4 tags
Automating dual deployment to the Mac App Store:... →
Apr 11th
2 notes
4 tags
Apr 11th
2 notes
Apr 11th
1 note
7 tags
iAd Gallery →
Apple has put an app in the app store that ONLY displays iAds. I’d just like to state for the record that back when I made my first ad-supported app (Fixed, which I later made $1 because ads are bullshit) I thought about doing exactly this. I’m certain if I had, it would have been rejected immediately.
Apr 10th
1 note
6 tags
Open-Source Cocoa Controls →
Some quality controls right here!
Apr 5th
10 notes
6 tags
Apr 4th
6 notes
March 2011
7 posts
6 tags
“Since Google’s business is advertising, shifting industries away from paying...”
– -Kyle Baxter, with a brilliant explanation of why it’s harder to make money on Android apps. (via marco)
Mar 31st
226 notes
5 tags
Neven Mrgan's tumbl: Broken iOS icons →
mrgan: Something is rotten in the state of iOS icons. More and more, I’ve been noticing app icons with good ideas behind them, pretty solid execution for the most part, and one hair-raising screwup practically designed to get the goats of oversensitive designers such as myself. These are some apps I just… Great post on some rookie iOS icon mistakes, with some tips on how to avoid...
Mar 30th
155 notes
6 tags
WWDC 2011
Just bought my ticket.
Mar 28th
1 note
4 tags
Mar 27th
2 notes
4 tags
Mar 24th
3 notes
6 tags
UIKit: Hide the keyboard without a reference to... →
A way more useful method than resignFirstResponder, because you don’t need a reference to the UITextField in question. [self.view endEditing:YES];
Mar 23rd
17 notes
6 tags
Mar 21st
February 2011
12 posts
3 tags
Feb 24th
17 notes
10 tags
A list of apps that won't be on your next iPhone?
Jim Dovey (alan quatermain) sets fire to Apple’s new policy on content purchasing: After another year, Apple decides that, since my application can display content purchased from my store (which isn’t even implemented in my app, it’s just a website), I must now implement in-app purchase of all my content. I hire more people to sort and input my 1 million items into the IAP database, and...
Feb 21st
10 notes