本地文件不可以url直接加參數,可以在uiwebview 加載好後 用js和oc 交互,傳遞參數。
參考:
?NSURL?*urlNosmoke?=?[NSURL?URLWithString:[NSString?stringWithFormat:@"nosmokeProgram.html"]];NSString?*strFilePath?=?[self.viewController.commandDelegate?pathForResource:[urlNosmoke?path]];
NSURL?*urlNonSmoking?=?[NSURL?URLWithString:@"?nonSmokingId=2013"?relativeToURL:[NSURL?URLWithString:strFilePath]];
NSURLRequest?*req?=?[[NSURLRequest?alloc]?initWithURL:urlNonSmoking
cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0f];[self.viewController.webViewEngine?loadRequest:req];