Maz*_*yod 8 iphone audio nsbundle ios4 uilocalnotification
我一直在寻找一个解决方案几个小时..绝对没有运气.
我设置了本地通知:
UILocalNotification *notif = [[cls alloc] init];
[dateComp setDay:j+1];
[dateComp setHour:[[time objectAtIndex:0] integerValue]+offset];
[dateComp setMinute:[[time objectAtIndex:1] integerValue]];
NSLog(@"Year: %i, Month: %i, Day: %i, Time:%i:%i\n",[dateComp year], [dateComp month],
[dateComp day], [dateComp hour], [dateComp minute]);
notif.fireDate = [gregorian dateFromComponents:dateComp];
notif.timeZone = [NSTimeZone defaultTimeZone];
notif.alertBody = [names objectAtIndex: k];
notif.soundName = @"fireburn.caf";
Run Code Online (Sandbox Code Playgroud)
注意声音名称......
我尝试放10个声音(aiff,wav,caf ...等),但通知只是弹出默认声音:/
我在Resources文件夹中有"fireburn.caf"文件.
为什么不播放我的声音?????
谢谢.
Maz*_*yod 10
回答:
代码没什么问题..
只是愚蠢的iPhone没有取消我使用默认声音发出的旧通知 - _ - ;
当我清理项目时,从手机中删除了应用程序并重新启动手机然后它工作了..
希望有人觉得这很有帮助.
| 归档时间: |
|
| 查看次数: |
10723 次 |
| 最近记录: |