zoukankan      html  css  js  c++  java
  • iOS/Xcode异常:reason: Unable to load iPodUI.framework

    在iOS 模拟器中测试音乐播放功能,使用多媒体选择器 MPMediaPickerController时,出现如下异常信息:

    reason: Unable to load iPodUI.framework

    模拟器无法访问设备的iPod 库,也就是无法访问设备的音乐库。

    要测试这一功能,必须使用实际设备,代码可以改进一下,捕获这一异常信息。

    - (IBAction)chooseMusic:(id)sender {
    MPMediaPickerController *musicPicker;

    musicPicker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic];
    musicPicker.prompt = @"请选择音乐";
    musicPicker.allowsPickingMultipleItems = YES;
    musicPicker.delegate = self;

    @try {
    [self presentViewController:musicPicker animated:YES completion:nil];
    }
    @catch (NSException *exception) {
    [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Oops!",@"Error title")
    message:NSLocalizedString(@"The music library is not available.",@"Error message when MPMediaPickerController fails to load")
    delegate:nil
    cancelButtonTitle:@"OK"
    otherButtonTitles:nil] show];
    }
    }

  • 相关阅读:
    机器学习---14
    机器学习---13
    机器学习--10
    机器学习--9
    机器学习--8
    机器学习--7
    机械学习--6
    大数据应用技术课程实践--选题与实践方案
    15.手写数字识别-小数据集
    14.深度学习-卷积
  • 原文地址:https://www.cnblogs.com/tuncaysanli/p/2727997.html
Copyright © 2011-2022 走看看