Ich habe eine Cordova
App erstellt und iOS
Plattform erstellt. Ich habe eine Anforderung, eine Objective-C
Methode in Xcode
zu verursachen und sie von JavaScript/HTML
Seite aufzurufen.Müssen eine Objective-C-Methode in Xcode erstellen und rufen Sie von JavaScript Cordova App
Der Code in AppDelegate.h ist
#import <Cordova/CDVViewController.h>
#import <Cordova/CDVAppDelegate.h>
@interface AppDelegate : CDVAppDelegate {}
@end
Der Code in AppDelegate.m ist
#import "AppDelegate.h"
#import "MainViewController.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
self.viewController = [[MainViewController alloc] init];
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end
Jeder Schritt-für-Schritt-Tutorial oder Beispiel?
Was eine "Xcode-Funktion" ist? – Droppy
Ziel C-Funktion? Ich bin neu zu xocde/objective C. Need ist ein Aufruf von Javascript und print NSLOG (@ "Erfolgreich eine obj c Methode von einer Javascript-Funktion aufgerufen"); – GMan