Discussion Forums  >  Crashes, Memory Warnings

Replies: 9    Views: 303

Sherry
Lost but trying
Profile
Posts: 135
Reg: Jan 05, 2013
South Africa
11,650
12/30/13 04:09 AM (10 years ago)

Multiple pdfs crash app

I'm creating my first iOS app on Buzztouch Self Host 2.1.9 (all plugins are updated) and Xcode 5. My app contains multiple pdf files which are causing it to crash after about 20 screens are opened and closed in quick succession (done during testing). The crash occurs on 2 different ipads one running iOS 6.1 and other iOS 7. If I close the app and stop from running in the background on ipads and re-open app everything runs smoothly again for next 10-20 screens and then either doesn't load the pdf properly or crashes app. I am ready for publishing to app store but have to fix this first. Please can someone help me because I am really new at this and dont have experience with coding.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
12/30/13 04:43 AM (10 years ago)
I'm curious what your logs are saying right before the crash… How big are the files? If you're using multiple huge files, you may be running into memory issues… you might try adding this code outside of any other method in your BT_screen_PDF plugin: - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } In earlier versions of xcode you would 'release' your objects when you were finished with them. Since iOS 7 and BTv3 is using 'ARC' I didn't think we were supposed to worry about that sort of thing, but maybe so… Cheers! -- Smug
 
Sherry
Lost but trying
Profile
Posts: 135
Reg: Jan 05, 2013
South Africa
11,650
like
12/30/13 05:53 AM (10 years ago)
Hi Smug thanks for your reply I do appreciate it. and managed to open about 30 pdfs before it crashed. Each pdf is a few hundred kb average around 300kb per pdf. Unfortunately I still need to compile this app for IOS6.1 because my client is still using IO6 devices so I haven't used BT 3.0 but remained on BT2.1.9 and copied 6.1 SDK from Xcode 4.3 so I could compile for 6.1 on Xcode 5 and also use it on an iOS7 device. Here is a copy of the log file from the bottom up to last 2 pdf files before it crashed (I didn't want to send you a list that was 10x longer than this unless you want it) X-CODE 5 (PART) LOG FILE: - I deleted it because David's files fixed issue.
 
Sherry
Lost but trying
Profile
Posts: 135
Reg: Jan 05, 2013
South Africa
11,650
like
12/30/13 05:55 AM (10 years ago)
Sorry I was going to also paste where I included your code on the BT_screen_pdfDoc.m and hit send to soon @implementation BT_screen_pdfDoc @synthesize dataURL, webView, externalURL, didInit, localFileName, saveAsFileName; @synthesize browserToolBar, downloader, downloadInProgress; -(void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } //viewDidLoad -(void)viewDidLoad{ [BT_debugger showIt:self theMessage:@"viewDidLoad"]; [super viewDidLoad];
 
Sherry
Lost but trying
Profile
Posts: 135
Reg: Jan 05, 2013
South Africa
11,650
like
12/30/13 07:52 AM (10 years ago)
This is why I LOVE BT because of the awesome people who make this possible as well as help each other along the way. WolfTimJ sent me the 4 files David fixed for him and I used it on my app and WHOOOO HOOOO it's working got to over 150 pdf files opened and closed and stopped counting because there were no crashes what so ever. My thanks to Smug, WolfTimJ and David because you guys ROCK!!
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/30/13 10:43 AM (10 years ago)
Can you share those four modified files? What in particular was needed to be changed? -- Niraj
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
12/30/13 12:14 PM (10 years ago)
I use BT 3.0 and still compile for IOS 6. Not a problem if you want to go that route.
 
Sherry
Lost but trying
Profile
Posts: 135
Reg: Jan 05, 2013
South Africa
11,650
like
12/30/13 12:40 PM (10 years ago)
Thanks Alan I will go that route shortly. I must admit I was waiting for the dust to settle a bit on the bug fixes so decided for this app to play it safe and stay on old BT. I have installed BT 3.0 Self Host on another sub domain on web server but haven't had a lot of time to test creating new apps on it. I have another app project for early 2014 so glad to know I can use BT3.0 for iOS6 that is until Apple changes its policy for iOS6 in I think I read Feb 2014. I have a question however is it just me or do you also have a little box with </> at the bottom right of all the screen icons in Grid View. Have a great evening Sherry
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/30/13 12:55 PM (10 years ago)
That little </> for the JSON is a fantastic capability that comes with BT V3. It allows a plugin developer to move at the speed of light without having to make a corresponding PHP file. You can also use that JSON Box in conjunction with Smug's CSV to JSON Converter tool. The Converter would run on your own Web Server or on your own Computer. You will find that tool at https://buzztouchmods.com/market -- Niraj
 
Sherry
Lost but trying
Profile
Posts: 135
Reg: Jan 05, 2013
South Africa
11,650
like
12/30/13 01:04 PM (10 years ago)
Thanks Niraj I will try that. LOL I am a novice when it comes to this so the first time I saw that on my self host server I thought all the plugins were broken :) then went to BT Control Panel and also saw them but wasn't sure why now it makes sense.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.