i´m getting these warnings for my code below.
Any ideas how to fix that?
Thanks for any help.
- Type specifier missing, defaults to ‘int’
- Incompatible pointer to integer conversion initializing ‘int’ with an expression of type ‘void *’;
- Unused variable ‘mymoviePlayerController’
The important line is the "__block mymoviePlayerController = nil;
- (void) moviePlaybackCompleteLightBox:(NSNotification*) notification {
MPMoviePlayerController *mymoviePlayerController = [notification object];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:mymoviePlayerController];
// movie fadein transition ====================
self.moviePlayerController.view.alpha = 1;
[UIView animateWithDuration:0.3f delay:0.0 options:UIViewAnimationCurveEaseOut
animations:^{
self.moviePlayerController.view.alpha = 0;
}
completion:^(BOOL finished) {
[mymoviePlayerController stop];
[mymoviePlayerController.view removeFromSuperview];
__block mymoviePlayerController = nil;
}];
}
First, you don’t have to set the
mymoviePlayerControllervariable to nil, if you don’ use it afterwards. Just don’t worry about it, removing the controller’s view from its superview is enough.Second, you can’t make a variable writable using the
__blockqualifier inside of a block. You’ll have to modify your code to make the variable writable outside of the block: