How can I read the iTunesMetadata.plist in Objective-C? (ipa file is on disk)

自古美人都是妖i 提交于 2019-12-12 02:04:50

问题


Ok I can get the list of IPA files in my iTunes folder. what I want to do is be able to read the plist file in the IPA file.

I'm very new to Objective-C so sorry if this is an obvious question (I did look).

I tried the following but it comes back null.

// i = NSURL. value eg. "file://localhost/Users/jiyeon/Desktop/test/test.ipa"
NSDictionary *plistInfo = [NSDictionary dictionaryWithContentsOfFile:[[i absoluteString] 
                           stringByAppendingPathComponent:@"iTunesMetadata.plist"]];

However plistInfo just ends up being null.


回答1:


Try -(NSString *)path NSURL

NSDictionary *plistInfo = [NSDictionary dictionaryWithContentsOfFile:[[i path] 
                       stringByAppendingPathComponent:@"iTunesMetadata.plist"]];

this should work



来源:https://stackoverflow.com/questions/5793347/how-can-i-read-the-itunesmetadata-plist-in-objective-c-ipa-file-is-on-disk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!