iOS Question Inline OBJC - Self

narek adonts

Well-Known Member
Licensed User
I tried. the first void is ok. but for the next 2 voids I can not pass page as parameter.
Please see code
-(void) MMShow: (UIViewController*)mypage
MPMediaPickerController *mediaPicker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeAny];
mediaPicker.delegate = self;
mediaPicker.prompt = @"Select Audio";
[mypage presentModalViewController:mediaPicker animated:YES];

-(void) mediaPicker:(MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)mediaItemCollection {
    NSArray *selectedSong = [mediaItemCollection items];
    if ([selectedSong count] > 0) {
        MPMediaItem *songItem = [selectedSong objectAtIndex:0];
        NSURL *songURL = [songItem valueForProperty:MPMediaItemPropertyAssetURL];
        //audioAsset = [AVAsset assetWithURL:songURL];
         NSLog(@"Audio Loaded");
    [self dismissModalViewControllerAnimated:YES];
-(void)mediaPickerDidCancel:(MPMediaPickerController *)mediaPicker {
    [self dismissModalViewControllerAnimated: YES];