И как ForgeLog
s, так и NSLog
s не отображаются в моем веб-инспекторе Safari, когда я тестирую. Я что-то делаю неправильно или намеренно?Журналы, не появляющиеся в веб-инспекторе
[ForgeLog d:@"Playing file at..."];
EDIT: Вот остальная часть кода для контекста. (На этот раз с помощью NSLog
.)
#import "audio_API.h"
static AVAudioPlayer* player = nil;
@implementation audio_API
+ (void)play:(ForgeTask*)task {
// parse the file url from the file object
ForgeFile* file = [[ForgeFile alloc] initWithFile:[task.params objectForKey:@"file"]];
NSString* fileURL = [file url];
NSLog(@"Playing file at %@", fileURL);
NSURL* url = [[NSBundle mainBundle] URLForResource:fileURL withExtension:@"m4a"];
// TESTING
//url = [[NSBundle mainBundle] URLForResource:@"seconds" withExtension:@"m4a"];
// END TESTING
NSAssert(url, @"URL is invalid.");
// create the player
NSError* error = nil;
player = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error];
if(!player)
{
NSLog(@"Error creating player: %@", error);
};
[player play];
[task success:nil];
}
Можете ли вы опубликовать метод, в котором вы его вызываете? –
@ChrisLoonam Я отредактировал мое сообщение по вашему запросу :) – Garrett