2013-04-14 2 views
1

테스트 할 때 ForgeLogNSLog이 내 Safari 웹 검사기에 표시되지 않습니다. 잘못되었거나 의도적입니까?웹 검사기에 로그가 나타나지 않습니다.

[ForgeLog d:@"Playing file at..."]; 

편집 : 나머지 코드는 다음과 같습니다. (이번에는 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]; 
} 
+0

전화하는 방법을 게시 할 수 있습니까? –

+0

@ChrisLoonam 귀하의 요청에 따라 내 게시물을 편집했습니다 :) – Garrett

답변

2

ForgeLogNSLog을 웹 관리자 콘솔에 기록하지 않습니다. 플러그인을 개발할 때 Xcode에서이 로그 출력을 볼 수 있습니다. 플러그인을 앱의 일부로 사용하면이 출력이 툴킷 또는 명령 줄 도구 출력에 나타납니다.

플러그인에서 웹 속성에 무언가를 표시하려면 이벤트를 통해 원시 코드에서 JavaScript 데이터로 통신하는 것이 가장 좋은 방법입니다 (http://docs.trigger.io/en/v1.4/modules/native/javascript_events.htmlconsole.log).

관련 문제