Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xiaohuli170

macrumors newbie
Original poster
Using

* (NSString *)webScriptNameForSelector🙁SEL)sel

{

if (sel == @selector(JSWriteCocoaAppLog🙂)
return @"WriteCocoaAppLog";
return nil;

}

* (BOOL)isSelectorExcludedFromWebScript🙁SEL)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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.