Gili Ariel
Gili Ariel

Reputation: 602

My app freeze after upgrading my device to iOS 8.3

I recently upgrade my device to iOS 8.3 from 8.1. my app worked fine on the device while it was set to version 8.1, but now after the upgrade it just freeze.

I debugged and figure out when and why it freezes. I have 5 array's with capacity of 50 that each contains strings received from different places (ble,gps,video). when the NSArray reaches it capacity i write everything down to a file and remove all objects from the NSArray. I have a UIButton that when it's pressed i start collecting the data to the NSArray and write it to the files ->That's when it freeze!

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:fileName];

//check if file exisits, if not creates one.
if(![[NSFileManager defaultManager]fileExistsAtPath:filePath])
{

    [[NSFileManager defaultManager] createFileAtPath:filePath contents:nil attributes:nil];
}
//writes and adds data the content to the specifec file.
NSFileHandle *fileHandler = [NSFileHandle fileHandleForUpdatingAtPath:filePath];
[fileHandler seekToEndOfFile];
[fileHandler writeData:[content dataUsingEncoding:NSUTF8StringEncoding]];
[fileHandler closeFile];

Any ideas why the upgrade version of the device have this affect on my app??

EDIT: The console log seems to be still running (I have him printing in what function he is at the moment) although the device is frozen.

Upvotes: 0

Views: 94

Answers (1)

Gili Ariel
Gili Ariel

Reputation: 602

As Ashwin suggested i moved my activity to the background thread and it works great!

Upvotes: 2

Related Questions