iphone - Differentiate iPhone4 vs. iPodTouch4 in Code -
i want programmatically differentiate between iphone4 , itouch4. here have tried :
+(bool) isiphone4 { if ( ![imagepicker isipodtouch4] ) { return no; } if ([uiimagepickercontroller respondstoselector:@selector(isflashavailableforcameradevice:)]) { if ([uiimagepickercontroller isflashavailableforcameradevice:uiimagepickercontrollercameradevicerear]) { return yes; } } return no; } +(bool) isipodtouch4 { if ([uiimagepickercontroller respondstoselector:@selector(iscameradeviceavailable:)] ) { if ([uiimagepickercontroller iscameradeviceavailable:uiimagepickercontrollercameradevicefront]) { return yes; } } return no; }
however, seems ipod touch 4 passing test iphone4. have ideas?
thanks.
this similar:
determine device (iphone, ipod touch) iphone sdk
the code example included allows tell exact device.
Comments
Post a Comment