I call the Objective-C method by using a JavaScript method using the following
Succeeded // // javascript function Hi () {CallNKitAction ("callFromJavascript className = TestCarouselViewController & Index =" + index); } Hello(); //// Objective c - (zero) callFromJavascript {NSLog (@ "before:% f", refToSelf.carouselView.alpha); [UIView startup permissions: zero reference: zero]; [UIView Set Animation Duration: 0.6f]; RefToSelf.carouselView.alpha = 0.0f; [UIView commitAnimations]; NSLog (@ "After:% f", refToSelf.carouselView.alpha); } But I do not know how to call the parameter. Anyone can help
Here are some code samples (inside Objective-C): < / P>
- (bool) webview: (UIWebView *) WebView shouldStartLoadWithRequest: (NSURLRequest *) Request navigationType: (UIWebViewNavigationType) navigationType {NSString * URL = [[request url] absoluteString]; Fixed NSString * urlPrefix = @ "myApp: //"; If ([url hasPrefix: urlPrefix]) {NSString * paramsString = [URL substringFromIndex: [urlPrefix length]]; NSArray * paramsArray = [Separator String from parameter string components: @ "& amp;"]; Int paramsmount = [Paramayera count]; (Int i = 0; i & lt; paramas amount; i ++) {nsarra * key valuepayer = [[ParamosArere ObjectItindex: I] Separate String from Components: @ "="]; NSString * key = [keyValuePair objectAtIndex: 0]; NSString * value = zero; If ([rice price] gear]> 1) {value = [keyValuePair objectAtIndex: 1]; } If {key (& amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; [length> & gt; 0] {if (value & amp; amp; amp; length> Inside JS:
location.href = 'myApp: // index = 10';
Comments
Post a Comment