Is there a way to detect the device using xcode? i mean when my app is running on iphone 3g show warning and says this feature only works 3gs Thanks.
Not detect device, but by function.
For example, if you need a compass, add the value magnetometer to the array UIRequiredDeviceCapabilities Info.plist (and the AppStore will filter the app for iPhone 3G.)
magnetometer
UIRequiredDeviceCapabilities
Info.plist
See http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedFeatures/AdvancedFeatures.html for details .