Using
* (NSString *)webScriptNameForSelectorSEL)sel
{
if (sel == @selector(JSWriteCocoaAppLog)
return @"WriteCocoaAppLog";
return nil;
}
* (BOOL)isSelectorExcludedFromWebScriptSEL)selector
{
if (selector == @selector(JSWriteCocoaAppLog)
return NO;
return YES;
}
*
(void)awakeFromNib { WebScriptObject* m_winScriptObject = [self windowScriptObject];
if (m_winScriptObject != nil) [m_winScriptObject setValue:self forKey"cocoaApp"];
}
methods I can received message from the javascript. just like cocoaApp.WriteCocoaAppLog("JSCommand"); in console can write the JSCommand. but after showing a swf file , I didn't receive the message from the javascript , I didn't know the reason.
* (NSString *)webScriptNameForSelectorSEL)sel
{
if (sel == @selector(JSWriteCocoaAppLog)
return @"WriteCocoaAppLog";
return nil;
}
* (BOOL)isSelectorExcludedFromWebScriptSEL)selector
{
if (selector == @selector(JSWriteCocoaAppLog)
return NO;
return YES;
}
*
(void)awakeFromNib { WebScriptObject* m_winScriptObject = [self windowScriptObject];
if (m_winScriptObject != nil) [m_winScriptObject setValue:self forKey"cocoaApp"];
}
methods I can received message from the javascript. just like cocoaApp.WriteCocoaAppLog("JSCommand"); in console can write the JSCommand. but after showing a swf file , I didn't receive the message from the javascript , I didn't know the reason.