Mailing Lists: Apple Mailing Lists

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

Re: Passing Arrays Between Widget and Plugin



Tom (and everybody else!),

Have you actually been able to make this work? I've tried it a few
different ways/times, and always get a crash.

I've modified the "JibbaJabba" (SimplePlugin) example I got from dts to show
how I think it should work...can you (or someone) take a look and tell me
what mistake I'm making?


It's in a zip called ModSimplePlugin.zip at http://homepage.mac.com/ mrakes/

Thanks in advance to any takers,
-mark


On May 10, 2005, at 10:25 PM, Tom Bunch wrote:

Yes. I suppose your NSArray is the result of a objC call? Supposing you've figured out how to call it already from javascript (see these methods)

+ (NSString *)webScriptNameForSelector:(SEL)aSel;
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSel;

you can do something like this:

var things = MyWidgetPlugin.someThings();
if (things) {
var thingCount = things.length;
for (var thingIndex = 0; thingIndex < thingCount; ++ thingIndex) {
var aThing = things[ thingIndex];
}


Does that help?  Your plugin class just has an instance method like:

- (NSArray *)someThings;

-Tom



On May 10, 2005, at 1:19 PM, Stefan Hanshans wrote:

Is it possible to obtain an array (NSArray) from a widget plugin in JavaScript?

TIA

Stefan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden
References: 
 >Passing Arrays Between Widget and Plugin (From: Stefan Hanshans <email@hidden>)
 >Re: Passing Arrays Between Widget and Plugin (From: Tom Bunch <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.