iphone - iTunes 文件共享。但通过http 共享? iOS系统

标签 iphone objective-c ios xcode cocoa-touch

我有一个文件想要共享。 '你好.mp3' 目前,如果文件位于应用程序中,则代码会启用文件共享。 我希望我能够通过 http 来做到这一点。因此,通过链接而不是应用程序中的声音共享文件。我想这样做是因为它可以为用户节省内存。

这是当前的代码。如果文件位于应用程序中,则代码允许文件共享。我想要它,以便用户可以从 http 服务器“下载”声音,例如 http://test.com/hello.mp3

谢谢

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    NSArray *names = [NSArray arrayWithObjects: @"hello.mp3", 
                                                @"hi.mp3", nil];
    for (NSString *fileName in names)
    {
        NSFileManager *fileManager = [NSFileManager defaultManager];
        NSError *error;
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *documentsDirectory = [paths objectAtIndex:0];
        NSString *documentDBFolderPath = [documentsDirectory stringByAppendingPathComponent:fileName];

        if (![fileManager fileExistsAtPath:documentDBFolderPath])
        {
            NSString *resourceDBFolderPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:fileName];
            [fileManager copyItemAtPath:resourceDBFolderPath toPath:documentDBFolderPath error:&error];
        }
    }
}

最佳答案

我可能是错的,但这可能是不被允许的。在指南中:

2.7 以任何方式或形式下载代码的应用程序都将被拒绝。

虽然音频文件可能不是“代码”,但如果它在应用程序中使用,也许作为语言翻译项目等...我认为它会被拒绝...不过我的 2 美分值得。

关于iphone - iTunes 文件共享。但通过http 共享? iOS系统,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8057496/

相关文章:

iphone - 限制UITextview的行数

iphone - 如何使 ScrollView 的内容透明

ios - 动画 CAShapeLayer

ios - Mapview 的 selectAnnotation 方法调用 deselect 方法也是 iOS

objective-c - UITableView/UITabBarController : trying to figure out a method to pass a variable to my destination controller when a row is selected

ios - 无法安装 Codename 一个 iOS 调试应用程序

iphone - UILineBreakMode 与 NSLineBreakMode

objective-c - iBooks如何实现高亮文本功能?

iphone - 如何在iphone中上传图片到远程服务器?

iphone - 在特定时间执行某项功能