2

Xcode Open File (epub) with xcode programming - NOT OPENING (O just see a little white block on upper right)

I have also added epub file in project, I am using following below code to open it in viewdidload method.

- (void)viewDidLoad
{
    NSString *filepath = [[NSBundle mainBundle]pathForResource:@"MyEpub" ofType:@"epub"];
    UIWebView *wv = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
    [self.view addSubview:wv];
    [wv loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:filepath]]];

    [super viewDidLoad];
}
Jano
  • 62,815
  • 21
  • 164
  • 192
Abhi
  • 31
  • 1
  • 4
  • 1
    possible duplicate of [Reading ePub format](http://stackoverflow.com/questions/1388467/reading-epub-format) – Jano Sep 25 '11 at 22:07

1 Answers1

0

Well, you won't be able to open an ePub file in a UIWebView, because it's not a supported format.

Apple provide a list of supported formats here:

http://developer.apple.com/library/ios/#qa/qa1630/_index.html

You'll need to use the link Jano provided above to decompress, parse, and open up the file.

lxt
  • 31,146
  • 5
  • 78
  • 83