Loading data from .plist files

  • Twitter
  • Facebook
  • Digg
  • Reddit
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks

Saving and Reloading from .plist files…
A great way to store dictionary data that does not change during runtime is in a .plist file. Say you want to organize some data hierarchically or you want to store the navigation structure of a drill-down somewhere more convenient (see drill-down save example in apple docs), then a .plist file is a great way to go.
Here’s a quick example of how to restore data from a plist file. I’ll use a plist …

February 14th, 2009 Posted by: - posted under:Snippets - View Comments READ MORE

Finding Substrings in Objective-C

  • Twitter
  • Facebook
  • Digg
  • Reddit
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks

It’s times like this, that I miss ruby.
I’m checking a url to see if it has a substring. It would be so easy if this was ruby:
absolute_url.match(/my regex/).any?
In Objective C, you have to use rangeOfString which returns a range. If I were to run this on the string “the quick brown fox” with an argument of “brown” it would return {10,14}. If it’s not found, it would return {NSNotFound, 0}. Let’s use that to check to …

November 3rd, 2008 Posted by: - posted under:Snippets - View Comments READ MORE

iPhone: applicationDidFinishLaunching & handleOpenUrl

  • Twitter
  • Facebook
  • Digg
  • Reddit
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks

Problem:
You use the applicationDidFinishLaunching method to kick off your application. This event fires automatically on your delegate whenever your app launches.
If your app launches from a special url schema (tel://, http://, mailto://), then another event is fired:
handleOpenUrl
As you might have noticed in the LaunchMe sample project that ships with Xcode, these two methods will most likely conflict.
Solution:
Move the functionality from applicationDidFinishLaunching and put it in another method, like postLaunch. Then add a member variable to the application delegate …

November 3rd, 2008 Posted by: - posted under:Snippets - View Comments READ MORE

Xcode SDK / iPhone OS Idiosyncracies

  • Twitter
  • Facebook
  • Digg
  • Reddit
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks

The Problem:
Recently, after upgrading an iPhone to the current iPhone development firmware Xcode was unable to detect the device. I first noticed this when trying to build directly to the device:
“no provisioned iphone os device connected”. Needless to say, the device was in fact connected.
After that, I opened the organizer and saw:
“unable to locate a suitable developer disk image…”.
The Solution:
Downloading and installing the current Xcode SDK. Wouldn’t it be helpful if the error message could tell you …

November 2nd, 2008 Posted by: - posted under:Articles - View Comments READ MORE

iPhone building/testing for the device

  • Twitter
  • Facebook
  • Digg
  • Reddit
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks

Building for the simulator is easy. Building for the device, however, can be troublesome, especially when using version control to share your code with other developers.
Often times, the project.pbxproj file ends up with settings that disable Xcode from building your application for the device. Here is a common and frustrating error:
CodeSign error: a valid provisioning profile is required for product type ‘Application’ in SDK ‘Device – iPhone OS 2.1′
That is not a helpful error message. In …

November 1st, 2008 Posted by: - posted under:Articles - View Comments READ MORE

Where for art thou daemons?

  • Twitter
  • Facebook
  • Digg
  • Reddit
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks

In short, they’re in Android, not the iPhone.
This is a common frustration to iPhone application developers and product visionaries. You can’t run applications in the background. Think of all the features un-implemented due to this colossal disclusion.
Granted, there’s a reason Apple chose to omit this from their SDK. Lucky for me and you, Android chose to pay special attention to it. What we would call “daemons” on a standard operating system, …

October 31st, 2008 Posted by: - posted under:Articles - View Comments READ MORE

RightSprite meet Android

  • Twitter
  • Facebook
  • Digg
  • Reddit
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks

Uhh, not that kind.
Yes! That one! The kind that Google makes.
Here at RightSprite we love new technology. Most of us here were early adopters of Ruby on Rails and jumped on the iPhone SDK as soon as we could.
Here we go again. Google’s new mobile platform is expanding our playground even further!
Check back for updates and an all new RightSprite Android App.
Google drawing inspiration from Dali?

October 28th, 2008 Posted by: - posted under:Articles - View Comments READ MORE

Finding your iPhone or iPod Touch Device ID

  • Twitter
  • Facebook
  • Digg
  • Reddit
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks

If we’ve asked you to provide your iPhone or iTouch Device ID, here’s how:

Connect the device to your Mac or PC.
On the “Summary” tab in iTunes, click the “Serial Number” label. You’ll notice “Serial Number” changes to “Identifier”.
Click on “Edit” in the menu at the top and select “Copy”.
Now you can paste the device ID into an email.

October 12th, 2008 Posted by: - posted under:Articles - View Comments READ MORE

NDA Lifted

  • Twitter
  • Facebook
  • Digg
  • Reddit
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks

It’s not exactly news, but Apple lifted their nda. We’re stoked to see that this platform might have the same potential for viral programming as other fav frameworks of ours.
More blog posts to come yielding helpful tidbits and tutorials for coding everyone’s favorite new platform.

October 9th, 2008 Posted by: - posted under:Articles - View Comments READ MORE