I am creating an application in which i need to start camera and scan QR code. I am using a class in through which scanner starts. it is fine in iPhone but crashes in iPad.
i am using the code
if(![[appDelegate.tabbarcontroller.viewControllers objectAtIndex:1] isMovingFromParentViewController]) {
[[appDelegate.tabbarcontroller.viewControllers objectAtIndex:1] popToRootViewControllerAnimated:NO];
}
Using defensive programming in iOS is a very good strategy to prevent crashes.
About your question, from Apple doc:
The link iphone-tutorial-better-way-to-check-capabilities-of-ios-devices by Mugunth Kumar provides the info you need to checke against device capabilities.
Hope it helps.