我一直在寻找一个解决方案的小时..绝对没有运气。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";
通知声音名称...
我试图把10周的声音(AIFF,WAV,CAF ...等),但通知只是会弹出默认的声音:/
我在资源文件夹中的“fireburn.caf”文件。
为什么不打我的声音?????
谢谢。
如果有人仍然应该有这个问题挣扎,我发现它可能需要做的一两件事。将音频文件拖放到项目中时,除了选中“复制...”之外,还可能需要选中“添加到目标”选项。该做的事情对我来说。无论如何感谢您的答案。 – 2012-06-16 16:22:58
真棒,但是再次,你的问题必须与你添加的任何资源文件(图像,声音,字体等); – Mazyod 2012-06-17 14:49:58