【发布时间】:2012-07-03 02:07:13
【问题描述】:
有没有办法检索我在 Plist 中的 url 并从中制作 webview?
【问题讨论】:
标签: iphone objective-c xcode uiwebview plist
有没有办法检索我在 Plist 中的 url 并从中制作 webview?
【问题讨论】:
标签: iphone objective-c xcode uiwebview plist
是的,您可以使用以下方式打开 plist:
NSString *path = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"your.plist"];
NSDictionary *plistDictionary = [[NSDictionary dictionaryWithContentsOfFile:path] retain];
然后您将能够在plistDictionary 中找到您的网址。
【讨论】:
[plistDictionary objectForKey:@"key_of_the_url"]。
codeNSString *path = [[NSBundle mainBundle] bundlePath]; NSString *finalPath = [路径 stringByAppendingPathComponent:@"Data.plist"]; NSDictionary *plistDictionary = [[NSDictionary dictionaryWithContentsOfFile:finalPath] 保留]; [plistDictionary objectForKey:@"twitter"]; NSLog(@"%@", plistDictionary);
NSLog(@"%@", [plistDictionary objectForKey:@"twitter"]);