我试图减少我的照片中的记忆泄露,因此,我利用仪器发现所有泄漏。 我设法消除了几乎所有的泄露,但空洞除外。
Instruments is telling me that i have a lot of NSPlaceholderstring leaks. The code that generated the leak (according to instruments) is:
if (nil == storedHash)
{
NSString *description = [[NSString alloc] initWithFormat:@"1 = %@ 2= %d", uId, service];
self.storedHash = description; // This line is the leak according to instruments
[description release];
description = nil;
}
return storedHash
储存 哈希的定义类似:
@property(copy) NSString* storedHash;
I tried everything i can think of:
- I used retain instead of copy
- I used an autorelease allocation of the NSString (stringWithFormat)
- I tried wrapping the code with an autorelease pool
上述任何内容都没有改变泄漏。 (在某些情况下,泄漏的变化类型,但仍有泄漏)
是谁?