Archive for the ‘iPhone’ Category

Searching for iPhone App Names

Friday, February 26th, 2010

iPhone OS 3.0 introduced Spotlight Search: Flick to the left and you can search through the apps you have installed as well as other things like contacts, calendars events, emails, songs and notes.

For apps the iPhone OS will look at the app name that you see under it’s icon. So typing ‘bird’ would find the Birdfeed app.

But the OS also looks at the name of the app as it appears in iTunes. Birdfeed’s name in the app store is “Birdfeed - A very nice Twitter client”, which is why Birdfeed shows up when you type ‘twitter’.

spotlight

When you download an app to your phone the .ipa file includes the actual app binary as well as an iTunesMetadata.plist file. This plist file contains the app’s name as it appears in iTunes.

Tweetie on the other hand doesn’t show up in the screen-shot above even though it is installed on the phone. Tweetie’s name in the app store is “Tweetie 2″ which doesn’t include the word ‘twitter’.

Follow us on Twitter

Troubleshooting A Wireless Network

Wednesday, February 24th, 2010

I just finished helping a family member across the country with their wireless network setup. Neither the local ISP or Netgear technical support were able to help.

Problem: An iMac plugged directly to a Netegear router via Ethernet connected to the Internet just fine, but a wireless connection from a MacBook didn’t work.

First we figured out that the router was a Netgear WPN824v3 and the devices we are trying to connect are an iMac, a MacBook and an iPhone.

The problem was that the MacBook was connected to the wireless network but wasn’t properly getting an IP address via DHCP.

We verified that plugging the Ethernet cable into the Macbook worked, so we knew that the Internet connection to the ISP worked fine, and the problem was only for wireless.

First we tried temporarily turning off all wireless security but that made no difference.

Next I found a simulation of the UI for that unit here. This made it a lot easier to see what options were available for that router.

We changed the default password for the router and enabled Remote Management. Now I could log in to the router and see the router’s actual settings.

The first thing I noticed was that the Mode for the wireless network was set to “Auto 108Mbps”. Did this router support 802.11n? And did it work with the built-in Airport card? A couple of Google searches turned up no answer.

So next I decided to try to get things working with just 802.11g.
First I set the Mode to “g and b” and set the Channel to “Auto”. That didn’t change anything. The MacBook could still connect to the wireless network, but not get an IP address.

Under Advanced/Wireless Settings I noticed an “108Mbps Settings” area. I checked “Disable Advanced 108Mbps Features” and un-checked “Enable eXtended Range(XR) Feature”

Success! The Macbook could now successfully get a DHCP IP address!

Before finishing, we made sure that the bottom of the router had a piece of paper with the router’s password and we disabled the router’s Remote Management feature and re-enabled the WPA2 password and re-verified that everything was still working as expected. We also made sure that the iPhone could also connect without any problems.

Happy Troubleshooting!

Follow us on Twitter

iPhone screenshots

Wednesday, February 4th, 2009

I’m used to taking screenshots using Xcode, part of Apple’s iPhone SDK.

So it was news to me that ever since the 2.0 firmware, you can take screenshots directly on your  iPhone:

Press and hold the Home button (round button on the front) then click the Sleep/Wake button (small button on top of the iPhone).

You’ll hear the camera sound and the screen will flash. Launch the Photos app and you’ll see your new screenshot in the Camera Roll.

iMob brings down GeoNames, other iPhone apps

Thursday, January 22nd, 2009

A lot of iPhone applications need to convert a user’s location from the latitude/longitude that the iPhone SDK returns into a postal code. This is primarily because a lot of APIs still use postal codes to look up information. This is the case for Hot Popcorn where we look up movie times using either a postal code or city, state.

The popular choice for doing this conversion is GeoNames, a web service run by Marc Wick free of charge under a creative commons attribution license. When an API is free, there have to be limits to set to prevent abuse. GeoNames limits usage in it’s terms of service to 50,000 requests per IP address per day.

But this is a new world with rich clients like the iPhone, each with their own IP addreess. So what happens when a free popular iPhone game like iMob uses GeoNames? Mayhem.

iMob Online is currently #5 in the Top Free Apps on iTunes and this has essentially brought down GeoNames:

The problem since yesterday evening is an enormously popular iphone application called iMob. It is hammering the server with > 100 requests per second which has the effect of a DDOS attack. I am trying to get in touch with the developers to have them remove this feature from their application.

This forced Marc to take down the server:

We have temporarily removed the domain ws.geonames.org from the dns setting to protect the server from exessive use by an iphone application. You can access the server with the domain ws5.geonames.org

Now any iPhone application trying to use GeoNames will fail. Thanks iMob!

Debugging iPhone Exceptions

Friday, August 1st, 2008

Hunting down crashes in an iPhone app often involves uncaught exceptions. Even if we’re running from the debugger at the time, the crash happens after the exception is thrown, so the only entries shown in the debugger’s stack are from the exception catching code.

We do get a printout of the stack at the time of the exception but it’s a numeric stack trace so we’ll need to use the atos command line utility to make sense of the numbers. Here’s an example of a crash in a development build of Tomatoes:

2008-08-01 21:10:20.138 Tomatoes[151:20b] *** Terminating app due to uncaught exception ‘NSRangeException’, reason: ‘*** -[NSCFString replaceCharactersInRange:withString:]: Range or index out of bounds’
2008-08-01 21:10:20.213 Tomatoes[151:20b] Stack: (
808163835,
806099672,
807978623,
807978527,
812533155,
812164939,
812716685,
22067,
35325,
812317455,
812317325,
824032771,
824024301,
824022997,
807779567,
807777675,
829004012,
816177936,
816214500,
8381,
8244
)
terminate called after throwing an instance of ‘NSException’
kill
quit

We’ll need to call atos for each stack entry and we’ll need to know the path to the app on disk: In Xcode right click on the app under Products and select ‘Reveal in Finder’, then right click on the app in the Finder and select ‘Show Package Contents’, find the executable and drag it to the Terminal window to get the path.

The entries in the stack that belong to our app will be have smaller values. In this case 22067 and 35325. So let’s see what we have:

atos -o /Users/pboctor/iphone/Tomatoes/build/Debug-iphonesimulator/Tomatoes.app/Tomatoes 22067
-[NSObject(MovieUtils) stripHTML:] (in Tomatoes) (MovieUtils.m:55)

atos -o /Users/pboctor/iphone/Tomatoes/build/Debug-iphonesimulator/Tomatoes.app/Tomatoes 35325
-[RottenCurrentMoviesTableController connectionDidFinishLoading:] (in Tomatoes) (RottenCurrentMoviesTableController.m:482)

It looks like after we’re done downloading some data, we call stripHTML and then crash while trying to replace some values in a string. Off to fix some code!

One final thing: If the numeric stack trace came from the app while running on the iPhone and not in the simulator, then we need to tell atos the proper architecture of the executable:

atos -o /Users/pboctor/iphone/Tomatoes/build/Debug-iphoneos/Tomatoes.app/Tomatoes -arch armv6 22067

Happy bug fixing.