Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bridged Cocoa object's method is undefined?



In my webview:

- (void) webView: (WebView*) webView windowScriptObjectAvailable: (WebScriptObject*) windowScriptObject
{
   [windowScriptObject setValue: [KanjiData new] forKey: @"KanjiData"];
}

KanjiData is defined as:

@interface KanjiData : NSObject
{
}
- (NSString*) test;
@end

@implementation KanjiData

- (NSString*) test
{
    NSLog(@"test called");
    return @"Test";
}

...

The JS of the webview's HTML:

    var data = "">

    window.alert(data);
    window.alert(data.test);

prints out (I've routed the alert function to NSLog()):

2005-10-04 15:01:16.263 App[1112] > <KanjiData: 0x372320>
2005-10-04 15:01:16.311 App[1112] > undefined

The KanjiData object as reflected to the JS is the KanjiData object's address.

data.test() wasn't working so I wanted to see if the reflected function was callable, and I guess it isn't.

? Anybody got a simple JS ->  ObjC test case I can look at?
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.