As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
I have a few different view controllers that use the method below to grab a logo image from the Kinvey File Store and display it in an imageView. I was noticing that after I implemented these calls, my apps memory usage was growing with every load of a view controller that used it. After some aggressive NSLogging, it looks like that if I use this method in a view controller, it doesn't get deallocated when it should. If I comment out this method, it deallocates normally. Any thoughts on why this is? I am using this in a few different VCs and the behavior is always the same. No call = normal deallocation. Call = retain cycle?
Turns out this is caused by something I didn't include in my code above. I was using the returned image to set the image property on an imageView. It appears that my use of the self.imageView.image= was causing the retain cycle. Specicfically, the use of the "self" cell. In case anyone has this issue in the future, I used the following code to get access to the self,imageView property without causing a retain cycle.
Nate Nash
- (void)fetchAgencyLogo
{
NSString *filename = [NSString stringWithFormat:@"%@.png", self.agency._id];
[KCSFileStore downloadFileByName:filename completionBlock:^(NSArray *downloadedResources, NSError *error) {
if (error == nil && downloadedResources.count > 0) {
KCSFile* file = downloadedResources[0];
NSURL* fileURL = file.localURL;
UIImage* image = [UIImage imageWithContentsOfFile:[fileURL path]]; //note this blocks for awhile
NSLog(@"This is an image: %@", image);
} else if (error == nil && downloadedResources.count == 0){
NSLog(@"No file with that name you moron.");
} else {
NSLog(@"Error: %@", error);
}
} progressBlock:^(NSArray *objects, double percentComplete) {
NSLog(@"percent Comp: %.2f", percentComplete);
}];