I'm helping working on a web application called domus.Link that is a php frontend for Heyu. Heyu is linux home automation software that is command line based. Anyway domusLink has the ability to display multiple templates depending on the signature of your browser (user agent), and it seems that the detection can be done with simple javascript. The framework that is used to develop the template for the iPhone is iui:
http://code.google.com/p/iui/Mind you, this is for a web app which will need to run on a web server somewhere and your iphone will need wifi access to run it. This is not a native iPhone app framework that it sounds like you're referring to.