Detecting which platform

Is there any way to detect what hardware IOS is running on, e.g. Iphone4,5 iPad etc. I have a program which runs ok if you have a good processor e.g. 5 upwards, but there is too much lag on iPhone 4 with sound. Is there a way in code to detect the processor or phone type?

THis was discussed here :

You can detect the processor with Target64

You could also just alter the plist so the app wont even launch on a iPhone 4