Posts Tagged 'Programming'

Tutorial: Chat App

Here’s a tutorial worth looking at if you’re as unfamiliar as we are — that’s “pretty darn unfamiliar indeed”, that is — with server programming:

Building an iPhone chat app from the ground up

In this article, work through the entire process of building an iPhone chat application from the server all the way to the user interface on the front end…

The iPhone side is all completely bog standard SDK you’re probably familiar with, so it’s a nice example of how a very little bit of PHP server code can be used to handle some realish-time communication needs with PHP and just a dash of SQL and XML. Nifty!

And if this is indeed something that would be handy for you, check out the author’s other articles while you’re there. Lots of XMLy and PHPy and so on webby goodness there, looks like.

h/t: ManiacDev via @rwenderlich!

Continue Reading →

Tip: Image Highlighting

So you want to have a highlight effect on an image like the one UIButton does? Hey, here’s a handy function to create a highlighted version of an arbitrary UIImage:

UIButton graphics highlighting


… On the left, you’ll see an image that is similar to the icon for the Calendar program on the iPhone. Next is that same image, highlighted by UIButton. The third image is highlighted with the function shown below. The two highlighted versions are almost exactly the same. You can tell the difference with a color-dropper tool, but I doubt you could tell them apart with the naked eye…

Yep, that looks pretty darn close to the real thing. Handy little addition for your bag of tricks!

Continue Reading →


This looks like an interesting framework for your web-backed application development — RestKit:

RestKit is an Objective-C framework for iOS that aims to make interacting with RESTful web services simple, fast and fun. It combines a clean, simple HTTP request/response API with a powerful object mapping system that reduces the amount of code you need to write to get stuff done.

Specifically, that means

  • A simple, high level HTTP request / response system.
  • Core Data support.
  • Database Seeding.
  • Framework level support for switching servers & environments (development/production/staging).
  • An object mapping system.
  • Pluggable parsing layer.

Code is on github and there’s a tutorial here — looks like it’s well worth looking into for your next web-centered project!

h/t: @Dylan_Beadle!

… and ManiacDev just posted about it too.


Continuing the above-mentioned tutorial: iOS SDK: Advanced RestKit Development

Continue Reading →

Cloud Syncing

So if you’re doing productivity applications, chances are that sooner or later you’re going to run into the question of how to sync your data files across multiple devices and/or platforms. A particularly good example of a category that finds that a compelling problem is task managers. Here’s a couple posts with worthwhile discourse on the subject:

To Sync or not to Sync

Discusses all the options the Today Todo people considered/observed others using:

  • Do it yourself – ie, Appigo’s Todo built on Moki Mobility.
  • MobileMe
  • Google Calendar
  • Google Docs
  • Evernote
  • File based sync – ie, Omnifocus syncs to MobileMe or a WebDAV folder
  • Dropbox

We’re inclined to think that the advantages of using Dropbox are reasonably compelling here, particularly if you’re resource constrained in your development.

Now, on the other hand, if you’re not particularly constrained by resources, take a read through Cultured Code’s (that’s the Things people) recent thoughts on the same topic:

State of Sync, Part II

… We were so intrigued that we decided to develop a sync solution based on Git’s core ideas. Since these were general ideas anyway, we decided to create a solution that isn’t tied to the specific properties or needs of Things. Instead we wanted to create a general framework that could be integrated with any application no matter what the specific data model or sync policies of this application were.

But we didn’t stop there. If you create something new, knowing that the technology will be needed on multiple platforms, it is worth thinking about a cross platform strategy. We ended up with detailed plans to create a JavaScript-based cross-platform data model framework with Git-inspired sync built in. This strategy required substantial portions of all versions of Things to be rewritten. It was clearly the most ambitious project we ever took on. Dissatisfied with our previous attempts, we didn’t want to settle with anything short of perfection…

Indeed. Well, we certainly encourage people whose tools we rely on ourselves to take that admirable approach. Around here though, “pretty darned good given the time and money constraints” is pretty much the highest possible target, and using Dropbox for sync functionality looks like a good first order approximation to that in most circumstances.

Finally, some more worthwhile comments on the first post here,

Sync with cloud – Today ToDo

First point. Resist ALL temptation to host own service. This will invariably lead to an enormous amount of dissatisfaction with the app itself as even the slightest outage will globally affect the perception of the entire application … At least if using a third party service, the blame can be transferred…

Yes. Yes, indeed.

Continue Reading →

License Scripting

Continuing our recent theme of pulling together Xcode scripting-related notes in preparation for that Xcode 4 upgrade soon, here’s a handy little Ruby script you might wish to take a look at for tips:

An Xcode 3 script which will insert a New BSD License comment at the head of a file. Place the caret at the top of your file (or select an existing header comment) and run the script via the Xcode script menu…

As usual, if you have any comments on changes needed to work with Xcode 4, please let us know!

Continue Reading →

Ad Hoc Redux

So as pointed out in comments on yesterday’s automated build post collection, if you’re thinking about that kind of thing you should be considering what kind of method you’re going to use for ad hoc build distribution; and that’s a good excuse to round up the latest developments on that front since we first noticed wireless options for investigation as well.

Personally, we’ve found no compelling reason to switch from iOS Beta Builder to meet our ad hoc distribution needs so far, and we note that it’s now up to version 1.5 and headed for the App Store; and apparently there’s also some interesting forks,

… There’s a fork with better support for using Dropbox as the storage medium – interesting. There’s also full command line support, helpful for people that want to script the entire build process…

that command line support being particularly interesting, and documented here:

iOS Ad-Hoc Beta publishing directly from Xcode

If you don’t want to use that for some reason, here’s a couple posts on scripting xcrun directly for use with Hudson or whatever:

Automating Over The Air Deployment for iPhone

Automated OTA iOS App Distribution

So there’s your dead simple solutions.

You want to step up the code involvement a bit, the Hockey framework has moved along nicely since we first noted it, hitting version 1.0 a few days ago and apparently having some serious upgrades planned for version 2.0. It requires setting up a server, and optionally integrating a client library into your code, but in return you get a variety of statistics on your installs and the client library provides convenient in-app upgrading instead of requiring the user to go back to the web to download each release. Which are no doubt valuable features if you have a large beta tester pool, but we haven’t seen that need yet, it’s rare there’s more than a couple people we’re ad-hoccing out to, so we haven’t felt the necessity to go to the effort of figuring out how to set that up so far.

What is completely new in recent months is the appearance of a fair collection of web services to accomplish these tasks. In alphabetical order:

AppMakr has a service called AppDrop, just for their customers it seems;

AppSendr has web/command line tools no doubt nicely scriptable;

Diawi is a service that … well, actually, we don’t see where there’s any advantage at all over posting BetaBuilder’s output on your own site;

TestFlight seems to be getting the most buzz, and it certainly is a very pretty website indeed, and helps connect you with testers apparently. Which is a minor point in its favor … but we’re still not seeing that there’s any compelling reason to use it rather than post your own distributions via BetaBuilder or Hockey.

Also, in the particular case of beta build distributions, we’re rather opposed to introducing another possible point of failure by using a third-party service. Scripting our builds to deploy them to our own server suits us rather better. Especially since those services are all apparently free right now, but with no readily apparent means of monetization, counting on them sticking around long-term seems a little iffy. Basing your workflow on either of the open source solutions strikes us as rather safer.

But hey, it’s quite possible we’re overlooking something; if any of you Dear Readers have some compelling reason to build your ad hoc deployment system around any of these third party services, please inform us!


Note followup post about the renamed HockeyKit and promised hosted service!

Another alternative, IPA Publisher — Over-the-air Ad-Hoc Distribution on Speed — although we’re not seeing that it has any obvious advantages over iOS Beta Builder, and is neither free nor Free apparently.

Continue Reading →

Automated Builds

So you noticed there’s a new Xcode out today? Nope, we haven’t grabbed it yet, there’s four projects currently needing finishing up before we dare start messing around with a brand new Xcode, but this is a good occasion to list the various links we’ve collected on automated build scripting and were waiting for Xcode 4 to be released before getting into them seriously to see if there’s any real advantage over the target build phase scripts we’ve generally been using for that kind of thing.

Seems the tool of general choice is Hudson, just lately forked to Jenkins, discussed for instance here and here but most thoroughly in this fine series:

Setting up an Automated Build in an iOS environment

Setting up an Automated Build in an iOS environment – part 2

Setting up an Automated Build in an iOS environment – part 3

Setting up an Automated Build in an iOS environment – part 4

If you don’t like Hudson for some reason, ANT is an alternative:

Automate iOS Builds With ANT

Although personally, as mentioned above we tend to gravitate more toward local script solutions, as discussed nicely here:

A deployment script for a generic Cocoa Mac application

A Cocoa application for running scripts

If you see anything interesting appear on automated build best practices with Xcode 4 that differs from the discussions above, let us know!


See tomorrow’s post for a discussion of various ad hoc distribution options to consider when designing your automation strategy!

Also, this Jenkins: The Definitive Guide (aka “Continuous Integration With Hudson”, apparently) open source book may be of interest.

Automate your iOS projects with rake

Continuous Integration with Jenkins

Ad-Hoc and App Store IPAs with xcrun

Continuous Deployment for iOS Apps (Jenkins + TestFlight)

Continuous Deployment for Mobile Apps (Bamboo + HockeyApp)

Continuous Build and Deployment for iOS and Android Apps

Jenkins+HockeyKit build scripts

Continuous Integration for Mobile Apps with Jenkins: SOASTA CloudTest for iOS Apps

Passing Xcode Environment Variables to Jenkins

Setting up Jenkins and Xcode and Github and Testflight on a brand new Mac Mini

Setting up Jenkins with conversion to JUnit test reports

Continuous Integration of iOS Projects using Jenkins, CocoaPods, and Kiwi

hostedci: Hosted Continuous Integration for iOS and Mac

cisimple: another hosted CI service

Travis CI: hosted service free for open source on Gihub; supports Mac and iOS

Greenhouse: another iOS/Android hosted service with free 2-app plan

Setting up Jenkins for Github and Xcode, with Nightlies

Automated Unit testing an iOS app with Jenkins

Auto build and deploy iOS apps using Jenkins

Continuous Integration of iOS Projects using Jenkins, CocoaPods, and Kiwi

Advanced Jenkins for iOS and Mac

Using Travis CI and Xctool to Build and Test iOS Apps

Continue Reading →

Face Detection

Here’s a nifty piece of code: doing face detection on pictures taken within your app, using OpenCV. And you know what, it actually works pretty darn well, to our moderate surprise.

It’s from an upcoming book which looks rather interesting:

This book will guide you through developing applications for the iPhone that make use of the onboard sensors: the three-axis accelerometer, the magnetometer (digital compass), the camera and the global positioning system. You?ll learn how to make use of these onboard sensors and combine them to build augmented reality applications…

Prerelease version available if you just can’t wait, or order it once published here:

h/t: @renderplace!

Continue Reading →

MyAppSales Open Sourced

So the landscape of App Store sales trackers has shaken itself out quite a bit since the wide variety we found a couple years back, but there’s one that’s kept nicely up to date, Oliver Drobnik’s MyAppSales; and now it’s open source!

One of the things that people know me for is for continuing to develop on MyAppSales, my favorite tool to download and keep those elusive sales report from iTunes Connect. It’s always been a hobby and until now I’ve allowed people to access the source in exchange for a mandatory donation. This went on for almost two years now.

Those donations never made sufficient money for me to pay for professional development. But I felt that I had to ask the approx. 500 people on the google group about their opinion as they might see their donation as a purchase and not like the idea of this software now being available for free. Boy was I wrong. Resoundingly people voted “+1″ for going OpenSource.

So here it is. It’s Open.

Code is on github with an MIT-style license, enjoy!

Continue Reading →

Heapshot Analysis

This post wins the award for Best Walkthrough of Using Instruments EVAR — step by step details on how to track down those Really, Really Hard To Find memory leaks too subtle for the analyzer to pick up on:

When is a Leak not a Leak? Using Heapshot Analysis to Find Undesirable Memory Growth

The “Heap Growth” and “Still Alive” columns provide a summation of all of the objects in that heapshot that still exist in all subsequent samplings of the heap. That is, in Heapshot 3, there were 36.08K of allocations spread across 260 allocation events that continued to exist throughout the rest of the run…

… Not only can we expand any given Heapshot iteration to see the inventory of permanent objects allocated in that iteration, but we can dive all the way down to the individual allocations and see a backtrace of exactly where it was allocated.

Turn on Record reference counts in the Allocations instrument. When the app isn’t running, hit the little (i) in the Allocations track in Instruments and click the check box. Then run the application and do the same set of samples (or turn this on from the beginning if you didn’t forget like I did).

Now, when you click through any allocation, you’ll see a list of events that includes the point of allocation and all subsequent retain/release events…

Read the whole thing!

Continue Reading →
Page 40 of 89 «...1020303839404142...»