菜鸟教程小白 发表于 2022-12-13 02:29:15

ios - iPhone SDK : Open Default Message tones list


                                            <p><p>在我的应用程序中,我想为即将到来的消息设置设置默认系统消息音。我怎样才能打开默认设备 alertTones 列表。</p>

<p>我尝试了以下代码,但它没有返回任何声音。</p>

<pre><code>NSFileManager *fileManager = [ init];
NSURL *directoryURL = ;
NSArray *keys = ;

NSDirectoryEnumerator *enumerator = [fileManager
                                     enumeratorAtURL:directoryURL
                                     includingPropertiesForKeys:keys
                                     options:0
                                     errorHandler:^(NSURL *url, NSError *error) {
                                       // Handle the error.
                                       // Return YES if the enumeration should continue after the error.
                                       return YES;
                                     }];

for (NSURL *url in enumerator) {
    NSError *error;
    NSNumber *isDirectory = nil;
    if (! ) {
      // handle error
    }
    else if (! ) {
      ;
    }
}
</code></pre>

<p>请帮忙。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>查看此链接 <a href="https://github.com/TUNER88/iOSSystemSoundsLibrary" rel="noreferrer noopener nofollow">https://github.com/TUNER88/iOSSystemSoundsLibrary</a> .我想您是否在使用我在 iPhone 中测试过的这个引用代码及其工作。我认为您正在 iPhone 模拟器中进行测试。它在模拟器中不起作用。所以,在设备中测试它的工作正常<img src="/image/rrt6F.png" alt="check the attach image which shows the list of the system sound"/> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - iPhone SDK : Open Default Message tones list,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/26272352/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/26272352/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - iPhone SDK : Open Default Message tones list