Les deux ForgeLog
s et NSLog
ne s'affichent pas dans mon inspecteur Web Safari lorsque j'effectue des tests. Est-ce que je fais quelque chose de mal ou est-ce intentionnel?Les journaux n'apparaissent pas dans Web Inspector
[ForgeLog d:@"Playing file at..."];
EDIT: Voici le reste du code pour le contexte. (Cette fois en utilisant 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];
}
Pouvez-vous publier la méthode dans laquelle vous l'appelez? –
@ChrisLoonam J'ai modifié mon message selon votre demande :) – Garrett