Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about iOS development and PDF

close ios done button

More
11 years 1 week ago #8732 by yılmaz
I want to close pdf when I clicked "done" button.
- (void)dismissReaderViewController:(RDPDFViewController *)viewController
{
[self dismissViewControllerAnimated:YES completion:NULL];
}

-(void)openPDF:(NSString *)bookId fileName:(NSString *)fileName title:(NSString *)title{
[self loadSettingsWithDefaults];


int result = [m_pdf PDFOpen:pdfFullPath:@"password"];
if(result == 1)
{




int pageno =1;
[m_pdf PDFThumbNailinit:pageno];
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismissReaderViewController)];
doneButton.title = @"Done";
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:m_pdf];


[navController.navigationBar setBarStyle:UIBarStyleDefault];
m_pdf.navigationItem.leftBarButtonItem=doneButton;

[self presentViewController:navController animated:YES completion:NULL];
}
More
11 years 1 week ago #8733 by emanuele
Replied by emanuele on topic close ios done button
Hi,

I tried to do the same steps to show show the reader with presentViewController method.
The only thing that you should fix, is the doneButton declaration: @selector(dismissReaderViewController:) instead of @selector(dismissReaderViewController).
The ":" allow to call your method (dismissReaderViewController) correctly.
More
11 years 1 week ago #8735 by emanuele
Replied by emanuele on topic close ios done button
When vClose method is called, the pdf will be saved if necessary. The vClose method is called in RDPDFViewController, viewWillDisappear method.
If I correctly understood, in your project you can open a pdf file, but you can't close it with your button, right?

Another thing that you should fix is - (void)dismissReaderViewController:(RDPDFViewController *)viewController definition.
if you call that method with the "done" button, it will pass itself as parameter, not RDPDFViewController; so, your method should be:
- (void)dismissReaderViewController
{
....
}
the RDPDFViewController instance is unused in your implementation.
in this way you can restore the previous declaration of the done button (@selector(dismissReaderViewController)) without ":".

Another question: openPDF and dismissReaderViewController methods, are implemented in the same class? If not, you should do it (it could be the most important reason).

Hope it could help
Time to create page: 0.400 seconds
Powered by Kunena Forum