Earlier in the week I helped a reader with a iPhone issue he was having. From this came two things I'd like to share with folks. Number one - don't use Flash (sorry, couldn't resist!).
First - don't forget that Safari on the iPhone has a development mode. This is critical for getting any type of feedback for JavaScript errors. How do you enable this? Go to your Settings, Safari page. At the very bottom is a Developer menu. Click it and you will see...

Obviously you want to ensure the Debug Console is turned on. Once done, if you return to the browser and rerun your page with the error, you will see a new notice:

Clicking that option will give you some details about the error:

It's no Firebug, but it's better than nothing.
So what's the second tip? The error the user had involved a simple jQuery call to a CFC that returned JSON. It worked perfectly everywhere but the iPhone. Why? The iPhone didn't like the fact that the result didn't have the proper mime type. I asked him to add this line before his cfreturn: <cfcontent type="application/json" reset="true">. Unfortunately this kinda breaks the reusability of the component. To be a bit more abstract, he could add a quick check for URL.returnFormat first and only use the content type when necessary.
Archived Comments
@Ray, great tip. The one thing that is most annoying to me is the inability to see the HTML and resources that get sent to the iPhone. (or better put, that don't get sent) IMO that is the biggest challenge in mobile device development.
We are releasing an update soon of our sosContent.cfc that helps us deal with issues like this. I plan to do a some videos. The bottom line is there is alot of cool stuff that can be done with skinning web sites. If we package this stuff up and make it approachable, duplicateable and sustainable then in theory we can all be happy. :) Well, at least this type of issue will have a solution. Take a peak on riaforge at the current sosContent and it will give you a hint of where we are going. Oh, we are packaging the technology up into CFish version 2. There is not code on the project for that yet... it is coming. The CFish also includes technology to deliver content to multiple devices. If anyone wants in on the beta (and these libraries; CFish, sosContent are full free OS projects)
At least with the simulator you can use something like ServiceCapture or Charles.
I know what service capture is but you are the second person this week (second ever for me) that mentioned charles. Guess I need to google that. Perhaps you should do a blog post on that.
I go back and forth. I _believe_ I paid for SC though. I don't know.
I'm using SC a bit more lately because I've switched to Chrome which doesn't support Firebug.
Oh nice! I have not used that before.
@John: http://www.charlesproxy.com/ - a java proxy, been around for ages, what we had to use before all this new-fangled firebug stuff :)
@Ray - maybe just me but the cfreturn code you said you added doesn't show up in the post (Chrome/OSX)
@Adam: Fixed, thanks. I've got a few bugs in my editor. :(
ServiceCapture is wonderful, but it may not be being updated anymore. If you check the forums here: http://kevinlangdon.com/ser..., the last post was in March of 09. I tried posting a couple times and the posts never show up, since Kevin has to approve all posts.
I just found something cool. This feature will also give you tips. I was using a specific device width in a meta tag. Safari said it had a tip for me. I clicked to view- and it suggested I use the constant "device-width" instead.
Damn nice.
@Chuck: Well now thats something I didn't know. I guess I'd encourage folks to use Charles instead.
Gah. I can't believe they still haven't fixed the mime type bug with CFC web services. :(
Thanks for this informative post an dit will help in Iphone development to whom who is in learning as well as who has some problems in iphone development.
http://www.socialfactory.ne...
Excellent Tips! I haven't read such tips and it will benefit in the phase of Iphone development.