so I had a category of NSCache:
@interface NSCache (SharedCache)
+(NSCache*)sharedCache;
@end
#import "NSCache+SharedCache.h"
@implementation NSCache (SharedCache)
+(NSCache*)sharedCache;
{
static NSCache* sharedCache = nil;
if (sharedCache == nil) {
sharedCache = [[self alloc] init];
[sharedCache setCountLimit:0];
}
return sharedCache;
}
@end
However ocasionnaly this gets deallocated and therefore my app crashes. If I retain sharedCache this problem is solved. What is the best way to have a shared NSCache to void crashes that it gets deallocated randomly?
Simple Matplotlib Animation Example
ReplyDeletePython Contour Plot Examples
Python Text to Speech
Python Matplotlib Bar Plot
Matplotlib Pie Chart
Python Line Plot Using Matplotlib
How to save figure in matplotlib pyplot