开发者

Unable to retrieve data in string

self.pdfPath = [[NSBundle mainBundle] pathForResource:@"iPhone_SDK_License" ofType:@"pdf"];
NSData *htmlData = [NSData dataWithContentsOfFile:pdfPath];
NSString *htmlstr = [[NSString alloc] initWithData:htmlData encoding:NSUTF8StringEncoding];

It is showing nil in htmlstr, so need some 开发者_Python百科assistance on it.


A pdf is not an html file so I assume that initWithData:encoding: just cannot understand the data and so fails.

Use stringWithContentsOfURL:encoding:error: to see the details of the error.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜