Q:

what is the best approach for developing a game to support all iphone devices

I am developing a game for Iphones using latest Xcode.
Whatever images and image positions i used in the game seems to work only for a certain device sizes. 
What is the best way to develop a game that suits for all Iphone sizes.

A:

You could build scalable sprites and images which should keep set proportions. Once you have built a function or two measuring the size of the device and working out a percentage based value you can re-use it all over the game to keep the best quality on whichever device is in use. I have some code to this effect available, just let me know if you need it and I will post away ;)
-(int)percX :(int)oldX{
double perc = oldX*100/320.0;
int newX = (deviceWidth*perc)/100;
return newX;
}
-(int)percY :(int)oldY{
double perc = oldY*100/568.0;
int newY =  (deviceHeight*perc)/100;
return newY;
}
-(int)percH :(int)oldH{
double perc = oldH*100/568.0;
int newH =  (deviceHeight*perc)/100;
return newH;
}
-(int)percW :(int)oldW{
double perc = oldW*100/320.0;
int newW =  (deviceWidth*perc)/100;
return newW;
}

Okay so these are the functions that calculate the percentage based on the device Proportions. I have used a template device of 320 X 568 but you can obviously change it to suit. Then you just call these when ever you need to set a position for something eg :
UIImageView *titleImageView = [[UIImageView alloc]initWithFrame:CGRectMake([self percX:56], [self percY:30], [self percW:208] , [self percH:96])];

So I would normally look at a screen on the 320 X 568 device in IB and get an idea of where I want the item and then afterward change the code to the percentage values. This scales very nicely across all devices but you will need to check and fine tune if something doesn't quite match up and adjust accordingly

