Tuesday 29 October 2013

Monday 28 October 2013

Warning: Attempt to dismiss from view controller while a presentation or dismiss is in progress!


Warning: Attempt to dismiss from view controller <UINavigationController: 0xb4a5ae0> while a presentation or dismiss is in progress!

If you got the warning like this . You can remove the warning with replace your code with this one.

if (![[self presentedViewController] isBeingDismissed])
    {
        [self dismissMoviePlayerViewControllerAnimated];
    }

Instead of:


 [self dismissMoviePlayerViewControllerAnimated];

Thanks,
R.Anusha



Tuesday 15 October 2013

How to detect the mode of profiles (Silent/ Vibrate/general) in iPhone?

How to detect the mode of profiles (Silent/ Vibrate/general) in iPhone?


Solution:


AVAudioPlayer plays on silent mode when MPMoviePlayer plays:

NSURL *url = [NSURL URLWithString:self.videoURL];
MPMoviePlayerViewController *mpvc = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
NSError *_error = nil;
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &_error];
[self presentMoviePlayerViewControllerAnimated:mpvc];





Thanks & Regards,
R.Anusha