スレッドのメイン関数に自動解放プールを追加するだけで、メモリ管理の問題が解決するはずです。このような
- (void)main
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
...
Your code here
...
[pool release];
}
または、新しい構文を使用する場合
- (void)main
{
@autoreleasepool {
... your code here ...
}
}
とにかく、ファクトリメソッドによって作成された、または明示的に自動リリースされたすべてのNSDateを確認する必要があります。クラスNSDateのすべてのファクトリメソッドを以下に示します。
日にち
dateWithNaturalLanguageString:
dateWithNaturalLanguageString:locale:
dateWithString:
dateWithTimeIntervalSinceNow:
dateWithTimeInterval:sinceDate:
dateWithTimeIntervalSinceReferenceDate:
dateWithTimeIntervalSince1970:
(Appleのドキュメントから)