Note that JSCocoa uses JavascriptCore, which is a private framework on the iPhone. The app store licenses prohibits this, your app might be rejected.
> ie. Some js files can be in defferent instance of JSCocoa . And one
> instace of js wants to access them with . notation in the js file.
> What should I do to make the '.' notation in a js file ?
Patch JSCocoa to have it use an instance variable (add BOOL useAutoCall in JSCocoa's class definition in JSCocoaController.h) instead of the current global one.
-Patrick
Since the license prohibits it, don't stake your app on it.
> Anyway, do you have an alternative of JSCocoa?
Someone suggested to bundle your own copy of JavascriptCore with your app. (Meaning downloading the Javascriptcore source, compiling it yourself, and including it as library in your project)
This would satisfy the app store requirement of "no private framework, no downloaded code".
> I used the most recent patch, "parmanoir-jscocoa-3008d25.zip". There
> is 'useAutoCall' in JSCocoaController.h.
> It's hard to understand your recommendation to use 'a.b()' notation in
> a js.
> I think that I failed to explain my problem.
>
> What I want is;
> The usage "theCommon.func_common(); " is an obligation of mine. (not
> '()', '.' is what I want)
> The a.b() notation must be acceptable on my-building-app.
> Can you advice to accomplish it?
[jsSpecific setUseAutoCall:NO];
This will apply to all jscocoa instances. If you want instance specific behaviour (what I understood from your first question), then you have to add an instance variable :
@interface JSCocoaController : NSObject {
JSGlobalContextRef ctx;
BOOL ownsContext;
id _delegate;
BOOL useAutoCall; // <----------------- add this for instance specific behaviour
> But nothing happen!
> That means 'theCommon.func_common' or 'theCommon.func_common()' does
> not work.
> Can you help this?
Why do you want multiple instances in the first place ? Why jsCommon and jsSpecific ?
-Patrick
Hi Benny,
I don't have time right now. Try to find a way to go with a single instance.
> When I search in AppStore with such keywords, HTML or javascript,
> I can find some interesting apps which have a script-capable.
> And I can get Opera browser in AppStore, also.
The app store accepts script libraries that are packaged in your app. Right now JSCocoa uses JavascriptCore which is private on the iPhone. If you want to bundle your own copy of JavascriptCore with your app, it might work. But once again, don't stake your app on it.
-Patrick
--
JSCocoa: http://inexdo.com/JSCocoa
Source: http://github.com/parmanoir/jscocoa/tree/master
Docs: http://code.google.com/p/jscocoa/
Group: http://groups.google.com/group/jscocoa
Unsubscribe: jscocoa+u...@googlegroups.com