Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-10-2011, 12:04 PM   #1 (permalink)
Registered Member
 
Join Date: Sep 2011
Posts: 2
neilaur is on a distinguished road
Wink QLPreviewController as subview

I have a little problem with the use of QLPreviewController. Indeed, I have to display a PDF in my application and this class works fine if I push the controller in the UINavigationController application. For this, I use this tutorial : (here).

The problem is that I need a UIToolbar at bottom of the view to accompany the PDF. So I created a new controller with a UIToolBar and a QLPreviewController but the QLPreviewController doesn't appear: my view for the QLPreviewController's view stay white.

This is the initialization code and adding the controller to the view:

Code:
PdfReaderViewController = [[QLPreviewController alloc] init];
[PdfReaderViewController setDataSource:self];
[PdfReaderViewController setDelegate:self];
[PdfReaderViewController.view setFrame:myViewForPdfReader.frame];
[PdfReaderViewController setCurrentPreviewItemIndex:sollIndex];
vuePourLecteurPDF = PdfReaderViewController.view;    
[PdfReaderViewController reloadData];
I notice that one of two methods... :

Code:
- (id <QLPreviewItem>) previewController: (QLPreviewController *) controller previewItemAtIndex: (NSInteger) index;
of the QLPreviewControllerDataSource is not called when reloadData. The second returns a positive integer:

Code:
- (NSInteger) numberOfPreviewItemsInPreviewController: (QLPreviewController *) controller;
I don't understand the problem, I know only that both methods are correct because i tested by pushing the QLPreviewController in the UINavigationController.

Any ideas ?

Thanks
neilaur is offline   Reply With Quote
Old 12-10-2011, 02:42 PM   #2 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Navigation controllers have a toolbar. Turn it on.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 12-11-2011, 02:50 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2011
Posts: 2
neilaur is on a distinguished road
Default

It's works !!!

Thank you very much for your reply

Last edited by neilaur; 12-11-2011 at 03:04 AM.
neilaur is offline   Reply With Quote
Reply

Bookmarks

Tags
ios, qlpreviewcontroller, view

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 408
11 members and 397 guests
7twenty7, AppsBlogger, David-T, Duncan C, HemiMG, heshiming, LunarMoon, Murphy, sacha1996, Sami Gh, teebee74
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,127
Posts: 402,915
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:46 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0