I would like to be able to execute a piece of code that is defined in a string. I am aware of performSelector: but the object that will perform the selector is going to be different.
Example strings
[[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo] hasFlash]
[UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceFront]
So what I would like to do is something along the lines of
SEL selector = NSSelectorFromString(@"[[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo] hasFlash]");
if (selector) {
// Show flash buttons
}