In my app I have a button to update the same app by ad hoc distribution. In that link I do the next action:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"itms-services://?action=download-manifest&url=http://url/manifest.plist"]];
So then it appears the alert message and I tap ok, and then the app is closed and it starts the installation.
the first question is: That´s this way the best way.
I´d like to manage the errors that it can happen, for example, It interrupts the connection.
Or if had an error, and it can not install the app, I´d like run the previous version.