I think that you are calling the alert in the thread operation. Try the code below:
-(void)processImage:(cv::Mat&)image {
int result;
videoProcessing(){
...
result = 10
}
if(result == 10){
[self performSelectorOnMainThread:@selector(showAlertMessage) withObject:nil waitUntilDone:YES];
}
}
-(void)showAlertMessage{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"The code is" message:@"10"
delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
}