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



Yes, it works fine.  Um, I don't have a lot of time today (ADA submission deadline tomorrow!) to look at this.  Here are a few things I've noticed:

This xCode project, well, it doesn't build a widget.  Which brings me to my top Dashboard request for Apple: an xCode project template?  It _does_ build a .widgetplugin.  

You included a copy of JibbaJabba.wdgt wherein you've modified the value of the Plugin key in the Info.plist, but you haven't updated the .html to reference your own class.  You probably also need to copy the .widgetplugin into the .wdgt.

I messed around with it that much and it will create an instance of your class, but the _javascript_ still doesn't recognize calls to it.  And that's all the time I have...  

Good luck!  Sorry.


On May 11, 2005, at 5:43 PM, Mark Rakes wrote:

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>)
 >Re: Passing Arrays Between Widget and Plugin (From: Mark Rakes <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.