+(NSString*)wwwFolderName
と+ (NSString*) pathForResource:(NSString*)resourcepath
をオーバーライドして解決できました+ (NSString*) pathForResource:(NSString*)resourcepath
を無効にするとPhoneGapの他の部分で問題が発生することがあります。
+(NSString*)wwwFolderName {
return [NSString stringWithFormat:@"%@/www",[super applicationDocumentsDirectory]];
}
+ (NSString*) pathForResource:(NSString*)resourcepath
{
NSBundle * mainBundle = [NSBundle mainBundle];
NSMutableArray *directoryParts = [NSMutableArray arrayWithArray:[resourcepath componentsSeparatedByString:@"/"]];
NSString *filename = [directoryParts lastObject];
[directoryParts removeLastObject];
NSString* directoryPartsJoined =[directoryParts componentsJoinedByString:@"/"];
NSString* directoryStr = [self wwwFolderName];
if ([directoryPartsJoined length] > 0) {
directoryStr = [NSString stringWithFormat:@"%@/%@", [self wwwFolderName], [directoryParts componentsJoinedByString:@"/"]];
}
if (![[self wwwFolderName] isEqualToString:@"www"]) {
return [NSString stringWithFormat:@"%@/%@",[self wwwFolderName],[self startPage]];
}
return [mainBundle pathForResource:filename
ofType:@""
inDirectory:directoryStr];
}