- (void)showMusicPlayer
{
[MediaPlayController releaseInstance];
MusicPlayController *musicPlayController = [[MusicPlayController alloc] init];
MusicPlayerViewController *musicPlayerViewController = [musicPlayController createMusicPlayerViewController];
HomeRunManagerAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[delegate showFullScreenView:musicPlayerViewController];
}
Method returns an object-c object with an +1 retain count.
I know I alloc a musicPlayController instance,and it will appear to play the music,but there is just leaking.I am not sure how to solve the warning,(or memory leaking.)
where should I release my object?
I think,
MusicPlayController *musicPlayController = [[[MusicPlayController alloc] init] autorelease];
is not a useful way.
Thanks for helping me.
Yes, you have to release
musicPlayControllerEither by
Or