 |
 |
|
 |
10-07-2008, 06:07 AM
|
#1 (permalink)
|
|
Registered Member
Join Date: Sep 2008
Posts: 36
|
Open a pdf file in a view
How can i simply open a pdf file?
First i've tried it with a imageView. The pdf file was there in the ib but when i've built the application thre was only a blank screen.
If i need the pdfkit.framework, how will i add the pallette to my ib 3.1.1 . It seems the had nerfed the preferences.
|
|
|
10-07-2008, 10:48 AM
|
#2 (permalink)
|
|
Registered Member
Join Date: Sep 2008
Posts: 36
|
Or is there a way to load a pdf file from the resources folder to my webview?
|
|
|
10-07-2008, 12:17 PM
|
#3 (permalink)
|
|
Registered Member
Join Date: Sep 2008
Posts: 36
|
Here some code of my first try.
Code:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"Einsatz_in_Unternehmen.pdf"];
NSData *pdfData = [NSData dataWithContentsOfFile:path];
NSURL *myUrl = [NSURL fileURLWithPath:path isDirectory:NO];
fileView = [UIWebView alloc];
[fileView loadData:pdfData MIMEType:@"application/pdf" textEncodingName:@"UTF-8" baseURL:myUrl];
I get a " *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFArray insertObject:atIndex:]: attempt to insert nil'" error.
Hope you can give me a hint.
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 494 |
| 51 members and 443 guests |
| alexanderlonsky, alexstuckey, atsd, BobK, bravetarget, BrianSlick, CHV, coconnor, cribasoft, dany88, dhouse, Dorald, Erle, espinallab, ethanwa, fede, Gamer211, GhostDog, gomugroup, Gudus, intomo, itakenocrud, javaconvert, johnnybluejeans, KenPletzer, kjelleinar, leeus, lepetitapps, MarkC, MiniRobinho, msu, nibby, NicolasD, Noise, P2k, pbcbvba, robotcult, sayhong, scribouillard, seriessix, spark86, svjim, treazer, tturk, Vonswanko, wassupdoc, winklllll, wooyaiz, x2on, ZunePod |
| Most users ever online was 779, 05-11-2009 at 10:55 AM. |
» Stats |
Members: 21,504
Threads: 35,785
Posts: 156,780
Top Poster: smasher (2,449)
|
| Welcome to our newest member, itakenocrud |
|