我有一个应用程序内购买的应用程序,当用户购买东西时,将一个html文件下载到我的应用程序的Documents文件夹中.
现在我必须检查这个HTML文件是否存在,如果是,则加载此HTML文件,否则加载我的默认html页面.
我怎么能这样做?随着NSFileManager我无法走出mainBundle...
我有一个WebView,我想从JavaScript调用Objective-C中的一个视图.有人知道我怎么做吗?
我的ViewController中有这个代码:
- (BOOL)webView:(UIWebView *)webView2
shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType {
NSString *requestString = [[request URL] absoluteString];
NSArray *components = [requestString componentsSeparatedByString:@":"];
if ([components count] > 1 &&
[(NSString *)[components objectAtIndex:0] isEqualToString:@"myapp"]) {
if([(NSString *)[components objectAtIndex:1] isEqualToString:@"myfunction"])
{
NSLog([components objectAtIndex:2]); [[Airship shared] displayStoreFront]; //<- This is the code to open the Store
NSLog([components objectAtIndex:3]); // param2
// Call your method in Objective-C method using the above...
}
return NO;
}
return YES; // Return YES to make sure regular navigation works as …Run Code Online (Sandbox Code Playgroud) 我有一个必须加载图像的Webview!当我上传这张图片时,我每次都看到与之前相同的图像,我必须重新启动我的应用程序才能看到新图像......我认为是一个缓存问题.我该如何解决?
我有这个问题对我来说没有解决....我需要检查我的webview的当前URL是否是我的应用程序的Documents目录中的本地文件....我怎么能这样做?
谢谢!
我创建了一个脚本,将一些文件保存在我的应用程序的Documents目录中.现在我需要将这些文件复制到我的"application.app"包中...
我怎么能这样做?感谢所有能帮助我的人.
iphone ×5
webview ×3
ios ×2
objective-c ×2
cocoa ×1
cocoa-touch ×1
directory ×1
uiwebview ×1
xcode ×1