Ios 使用plist和tableviw在detailview的webview中加载html文件时出现问题 我有a1.html、a2.html、b1.html、b2.html作为本地资源 应用程序。 我在使用plist和plist加载这些html文件时遇到问题 将tableview转换为detailview的webview
普利斯特 topics.plistIos 使用plist和tableviw在detailview的webview中加载html文件时出现问题 我有a1.html、a2.html、b1.html、b2.html作为本地资源 应用程序。 我在使用plist和plist加载这些html文件时遇到问题 将tableview转换为detailview的webview,ios,uitableview,webview,plist,detailsview,Ios,Uitableview,Webview,Plist,Detailsview,普利斯特 topics.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>HN</key> <arr
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>HN</key>
<array>
<dict>
<key>Name</key>
<string>Boston</string>
<key>File</key>
<string>a1</string>
</dict>
<dict>
<key>Name</key>
<string>Massachussets</string>
<key>File</key>
<string>a2</string>
</dict>
</array>
<key>LEA</key>
<array>
<dict>
<key>Name</key>
<string>Birmingham</string>
<key>File</key>
<string>b1</string>
</dict>
<dict>
<key>Name</key>
<string>Alabama</string>
<key>File</key>
<string>b2</string>
</dict>
</array>
DEATAILVIEW
TopicDisplayViewController.h
#import <UIKit/UIKit.h>
@interface TopicDisplayViewController : UIViewController {
IBOutlet UIWebView*topicview;
NSString*htmlfile;
}
@property (retain) NSString*htmlfile;
@property (nonatomic) UIWebView*topicview;
@end
#import <UIKit/UIKit.h>
@interface TopicDisplayViewController : UIViewController {
IBOutlet UIWebView*topicview;
NSString*htmlfile;
}
@property (retain) NSString*htmlfile;
@property (nonatomic) UIWebView*topicview;
@end
#import "TopicDisplayViewController.h"
@interface TopicDisplayViewController ()
@end
@implementation TopicDisplayViewController
@synthesize htmlfile;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
NSString *bundle = [[NSBundle mainBundle] bundlePath];
NSString *webPath = [bundle stringByAppendingPathComponent:htmlfile];
[topicview loadRequest:[NSURLRequest requestWithURL:
[NSURL fileURLWithPath:webPath]]];
}
@end