Table of Contents Previous Section
Accessing WebScript Methods From
As stated previously, you can mix WebScript and Objective-C code. Often, programmers use WebScript for component logic, and then supply the bulk of the application (the "business logic") in compiled code.
Objective-C Code
id myObject = [[MyCustomObjCClass alloc] init];To access a WebScript object from Objective-C code, you simply get the object that implements the method and send it a message. If you're accessing a method in the application script, you can use this WOApplication method to access the object:
[[WOApplication application] applicationScriptMethod];To avoid compiler warnings when accessing WebScript objects from Objective-C, create a header file for the scripted component as though it were compiled. This step isn't strictly required, of course-your code will still build, you'll just get warnings.
Table of Contents Next Section