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: Objective-C Plugin Calls Wrong Method



Please disregard... I copied some code I found online, and the code for isSelectorExcludedFromWebScript and webScriptNameForSelector looked like this:

if (sel = @selector(connect)) {
...
}

After changing it to the equality operator, everything works as expected.
Thats what I get for trusting examples online. ;-)

Thanks!

-jake


On Aug 6, 2006, at 10:05 AM, Jake Goulding wrote:

I am creating a simple little Obj-C plugin to do some basic network commands which entails sending some requests and reading responses over a socket, very simple stuff. However, When I call into the plugin from _javascript_, it always calls the function that is last in the code.

For example, this was the order of my methods:

...
connect
checkDescription
getList

and every time I would call connect from _javascript_, I would end up calling getList. I confirmed this by setting breakpoints and doing backtraces in gdb. This is particularly bad because I have to call connect first, before anything can work!

I then added a dummy function to the end of the file:

...
connect
checkDescription
getList
dummy

dummy simply prints to NSLog. Now when I call connect, dummy is called!

I'd appreciate any pointers to what I could be doing wrong.

Thanks!

-jake
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
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: 
 >Objective-C Plugin Calls Wrong Method (From: Jake Goulding <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.