2011-08-05 6 views
0

を警告私は、次の2つのメソッドを持っています。しかし、コンソールで次の警告が表示されます。IOS:リークが明確でない

2011-08-06 00:26:56.298 Alarm[82648:5d03] *** __NSAutoreleaseNoPool(): Object 0x4e350e0 of class __NSArrayM autoreleased with no pool in place - just leaking 
2011-08-06 00:26:56.299 Alarm[82648:5d03] *** __NSAutoreleaseNoPool(): Object 0x4e350c0 of class NSCFString autoreleased with no pool in place - just leaking 
2011-08-06 00:26:56.300 Alarm[82648:5d03] *** __NSAutoreleaseNoPool(): Object 0x4b43c00 of class NSCFString autoreleased with no pool in place - just leaking 
2011-08-06 00:26:56.300 Alarm[82648:5d03] *** __NSAutoreleaseNoPool(): Object 0x4b46900 of class NSPathStore2 autoreleased with no pool in place - just leaking 
2011-08-06 00:26:56.301 Alarm[82648:5d03] *** __NSAutoreleaseNoPool(): Object 0x4e37630 of class NSPathStore2 autoreleased with no pool in place - just leaking 
2011-08-06 00:26:56.302 Alarm[82648:5d03] *** __NSAutoreleaseNoPool(): Object 0x4e35100 of class __NSArrayI autoreleased with no pool in place - just leaking 

これはどういう意味ですか?

答えて

3

おそらく、あなたはメインスレッドではなくこのメソッドを実行しています。そうしたら、NSAutoreleasePoolを作成する必要があります。

-(void)playSound { 
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 
    int index = rand() % [soundFilenames count]; 
    NSString* filePath = [self getBasePath]; 
    [pool drain]; 
} 
+0

本当にありがとうございました。 – toom

関連する問題