-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
Problem:
I sync 15 MB files using FTASync and the instruments says that [FTASyncHandler syncAll] takes 15MB memory which is not reasonable
So I changed the code in FTASyncParent.m :
- (void)updateObjectWithRemoteObject:(PFObject *)parseObject {
NSDictionary *attributes = [[self entity] attributesByName];
NSDictionary *relationships = [[self entity] relationshipsByName];
//Set all the attributes
if (self.syncStatusValue != 1) { //Local changes take priority
for (NSString *attribute in attributes) {
NSString *className = [[attributes valueForKey:attribute] attributeValueClassName];
if ([className isEqualToString:@"NSData"]) {
PFFile* remoteFile = [parseObject objectForKey:attribute];
[self setValue:[remoteFile getData] forKey:attribute]; //CHANGED HERE
remoteFile = nil; //CHANGED HERE
continue;
}
And I run the app again and the [FTASyncHandler syncAll] takes 33.88KB only this time (see the attachment photo:)
(Note: in .xcdatamodel, the binary data field, I checked the "Allows External Storage" box to reduce use of memory of core data)
Can you please update the code in FTASync according to the code above?
Metadata
Metadata
Assignees
Labels
No labels
