iSimulate Update 1.5
Depending on the type of applications you are building, iSimulate may be just the tool you you need, as it allows testing of functionality on the simulator that is not natively supported through Xcode.
I just got word from vimov, the company behind iSimulate that their latest release 1.5 is now available and includes two key updates:
- All UIKit objects now receive touch events, including scrolling and the keyboard.
- On the iPhone 3GS, events can now be captured by the magnetenometer (compass) and sent to the iPhone Simulator.
If you are not familiar with iSimulate, here is an older post that may be of interest: Introduction to iSimulate. And just for fun, here is a post regarding a giveaway coordinated between iPhone Developer Tips and vimov: iSimulate Giveaway: We Have a Winner.
Gotcha: Case Sensitive PNG Filename
Here’s one that will trip you up if you aren’t careful…look at this code:
timerButton = [[UIButton alloc] initWithFrame:CGRectMake(104, 410, 50, 50)]; // Notice the filename "timer.png" [timerButton setBackgroundImage:[UIImage imageNamed:@"timer.png"] forState:UIControlStateNormal]; [timerButton addTarget:self action:@selector(buttonPressed:) forControlEvents: UIControlEventTouchUpInside]; [self.view addSubview:timerButton];
Simple enough, create a button, use the image timer.png for the normal state, and all is well…if you run this code in the simulator. Problem is, if the actual filename of the image is Timer.png the png file will not appear when running this code on device.
If you haven’t run into this while developing an iPhone app, you can’t fully appreciate how time consuming it can be to track this down.
Note: I ran into this while working with Xcode 3.2.1 and building for iPhone OS 3.1.2
Detect Taps on UITabBarController and Determining Class Type
I’ve been working on an application which uses a UITabBarController as the primary means of navigation. One of the tabs leads one to a UIViewController that displays a UIWebview as the main user interface.
The browser based navigation in the webview is based on a legacy (read WAP) website that has a great deal of content, however, it has yet to be updated to take advantage of current browser technology.
The client asked if when a user is on the tab with the browser showing, and would like to return to the home page, rather than navigating with browser-based back buttons, could one tap on the tabbar (again) to reload the main webpage?
Continue reading this post »
Playing Sounds/Audio – AVAudioPlayer
I previously wrote about using Audio Session Services which offers a quick and easy approach for playing short sounds. However, there are a number of limitations, including no control over the volume, playing time is limited to 30 seconds and the only file types supported are AIFF, WAV and CAF.
Sounds with AVAudioPlayer
AVAudioPlayer offers a much wider range of capabilites, including pausing playback, adjusting the volume, tinkering with the playback time (setting and detecting) as well as features for monitoring audio peaks and averages.
The code below shows the basics for setting up a player and playing a sound:
Continue reading this post »
Fade Transition – Fade Images In and Out
Although the iPhone includes a number of effects designed for transitioning between views, sometimes a simple fading effect of one image to another, within the same view, is all you need.
For example, in a recent application during the application startup, I wanted the splash image to fade away, and another image of the primary user interface, to become front and center.
The effect I was after looks similar to the video shown below:
Continue reading this post »
UIAlertView and Landscape Mode
I bumped into a rather odd UI issue early last week – I was working on an application which runs entirely in landscape mode. However, when I displayed an alert view, it came up as follows:

Setting Landscape Mode
In my application, I had the following interface orientation setting inside the info.plist file:
Continue reading this post »
Book Giveaway: Head First iPhone Development – Winner Announcement
Each Friday in November, O’Reilly and iPhone Developer Tips is giving away an eBook copy of O’Reilly’s Head First iPhone Development.
Winner for this week
This weeks winner is Woongcheol Yang, congratulations Woongcheol!
Woongcheol is from South Korea and is currently a computer science major at Princeton University. Mostly interested in developing web applications, Woongcheol does have an iPod touch 2G and has spent some time playing around writing iPhone apps. As Woongcheol mentioned to me “I haven’t written any substantial iPhone apps yet, but now I have the book so that I can really jump into it!”
Enjoy the book Woongcheol and good luck with your projects.
Thank you
I’d like thank everyone who registered in the drawings over this past month, and of course, many thanks to Laurel Ackerman of O’Reilly for providing the eBooks!
Does iPhone Support Camera and Recording of Video?
This is the final tip in a series of four that is based on content from the O’Reilly book Head First iPhone Development. O’Reilly and iPhone Developer Tips are collaborating to give away a free ebook (electronic copy) of Head First iPhone Development each Friday in November. You can register in this weeks drawing by referring a friend to this tip – see the Refer-a-Friend button near the bottom of this post.
This tip is from Chapter 9 – Camera, Mapkit and Core Location and shows how to make a quick check on the status/availability of the camera on device.
Continue reading this post »
Book Giveaway: Head First iPhone Development – Winner Announcement
Each Friday in November, O’Reilly and iPhone Developer Tips will giveaway an eBook copy of O’Reilly’s Head First iPhone Development.
The giveaway works like this:
Each Monday in November I’ll write a tip that is based on ideas and code in the book. Through out the week, you can register for the book giveaway by referring a friend to the tip. The deadline to enter the drawing for the week ends on Thursdays, at 6:00PM CST.
I will then draw a name from those who registered and announce the winner on each Friday in November.
Winner for this week
This weeks winner is Mike M, congratulations Mike!
Thank you to everyone who registered in the drawing. If you didn’t win this week, please visit iPhone Developer Tips again on Monday the 23rd for another tip from Head First iPhone Development, and you can register in the drawing for Friday, November 27th.
Cartoons to Go! iPhone Application
I thought I would pass along that an application I originally submitted in February (yes, February) has finally been approved. Cartoons to Go! is a video streaming application that does just one thing, play vintage cartoons.
No Frills UI
The application that is now available on the App Store has little similarity to the original application that I submitted. The reason being, as the amount of time involved to continually make changes to get approved increased, the capabilities of the user interface decreased.
Continue reading this post »
Post to a Twitter Account from the iPhone
This is the third tip in a series of four that is based on content from the O’Reilly book Head First iPhone Development. This tip is from a code sample in Chapter 3 – Objective-C for the iPhone, and shows how to post to a Twitter account.
Continue reading this post »
Book Giveaway: Head First iPhone Development – Winner Announcement
Each Friday in November, O’Reilly and iPhone Developer Tips will giveaway an eBook copy of O’Reilly’s Head First iPhone Development.
The giveaway works like this:
Each Monday in November I’ll write a tip that is based on ideas and code in the book. Through out the week, you can register for the book giveaway by referring a friend to the tip. The deadline to enter the drawing for the week ends on Thursdays, at 6:00PM CST.
I will then draw a name from those who registered and announce the winner on each Friday in November.
Winner for this week
This weeks winner is Steven Nguyen, congratulations Steven!
Thank you to everyone who registered in the drawing. If you didn’t win this week, please visit iPhone Developer Tips again on Monday the 16th for another tip from Head First iPhone Development, and you can register in the drawing for Friday, November 20th.
Resize/Scale of an Image – Take 1 – Using an Objective-C Category
Editor’s Note: Part 2 of this post Resize/Scale of an Image – Take 2 – Thread Safe Approach takes this idea to the next level, showing how to dynamically resize images using thread safe code.
Given how common it is to scale an image within an application, it’s surprising (at least to me) that such a method is not included in the UIImage class. Let’s go ahead and take care of this omission by adding a simple method which will provide a means to scale an image.
We’ll use an Objective-C category to add a method to the UIImage class. I covered categories in this post. No question, categories are your friend, as they are very handy in cases such as this, where you would like to add functionality to an existing class.
Continue reading this post »
Reading a plist into an NSArray
Reading a plist into an NSArray
This is the second tip in a series of four that is based on content from the O’Reilly book Head First iPhone Development. The first tip described how to adjust textfields that are hidden when the onscreen keyboard is shown.
Continue reading this post »
Book Giveaway: Head First iPhone Development – Winner Announcement
On Monday of this week I announced a new contest for the month of November – Each Friday iPhone Developer Tips will giveaway an ebook copy of O’Reilly’s Head First iPhone Development.
The giveaway works like this:
Each Monday in November I’ll write a tip that is based on ideas and code in the book. Through out the week, you can register for the book giveaway by referring a friend to the tip. The deadline to enter the drawing for the week ends on Thursdays, at 6:00PM CST.
I will then draw a name from those who registered and announce the winner on each Friday in November
Winner for this week
The winner of the eBook for this week is: Bill Mietelski – here’s a little more about Bill:

“I’m currently a Software Engineer at a leading national academic medical center in the Chicagoland area, working on statistical research studies. I heard about your website & the eBook giveaway on Twitter (via @OReillyMedia).”
“I don’t have an iPhone (yet) but I’m thinking about pulling the trigger soon. I’m a *huge* fan of O’Reilly’s Head First series of books, and I couldn’t think of a better way to get started than with a copy of Head First iPhone Development, so I entered the giveaway.”
“Now that I have the book, maybe you can have an actual iPhone giveaway :-)”
Bill sent me an impressive picture of his collection of O’Reilly books. I thought I had a nice collection, however, looks like I have some catching up to do.

Congratulations Bill!
Thank you to everyone who registered in the drawing. If you didn’t win this week, please visit iPhone Developer Tips again on Monday the 9th for another tip from Head First iPhone Development, and you can register in the drawing for Friday, November 13th.








