Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about iOS development and PDF

TOPIC:

can't load network PDF file 8 years 7 months ago #9518

  • NovaRadaeePdf
  • NovaRadaeePdf's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
I have found the reason of slow loading. because I want to make my APP is fluent. so I used the asynchronous processing. but it has extended the loading time. I don't understand why! We only load the PDF on the main thread? And I found load PDF with the main thread in the demo. Why don't we use multithreading and can you tell me how to modify?

Please Log in or Create an account to join the conversation.

can't load network PDF file 8 years 7 months ago #9522

  • NovaRadaeePdf
  • NovaRadaeePdf's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
Who can help me?! I'm in a hurry! Thanks! :( :( :( :( :(

Please Log in or Create an account to join the conversation.

can't load network PDF file 8 years 7 months ago #9553

  • NovaRadaeePdf
  • NovaRadaeePdf's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
Can you answer my question?

Please Log in or Create an account to join the conversation.

can't load network PDF file 8 years 7 months ago #9556

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Hi,

a process started in in an asynchronous thread, is a low priority process, so the download process could take much time.
You should try to call only the download process on main thread.

Please Log in or Create an account to join the conversation.

can't load network PDF file 8 years 7 months ago #9559

  • NovaRadaeePdf
  • NovaRadaeePdf's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
I want to know do you have a way to solve this problem, asynchronous and fast.

Please Log in or Create an account to join the conversation.

can't load network PDF file 8 years 7 months ago #9560

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
you can do all the operations in background, but, to avoid delays, the PDFOpenStream method and the UI activities should be called on main thread.
Something like:
[self performBlockOnMainThread:^{
        [m_pdf PDFOpenStream:httpStream :@""];    
        m_pdf.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:m_pdf animated:YES];
}];

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum