iphone - I do not know how to fix the leak -


how fix leak here?

-(nsarray *)sectionindextitlesfortableview:(uitableview *)tableview {    if(searching){           return nil; }  nsmutablearray *temparray = [[nsmutablearray alloc] init]; [temparray addobject:uitableviewindexsearch]; [temparray addobject:@"a"]; [temparray addobject:@"b"]; [temparray addobject:@"c"]; [temparray addobject:@"d"]; [temparray addobject:@"e"]; [temparray addobject:@"f"]; [temparray addobject:@"g"]; [temparray addobject:@"h"]; [temparray addobject:@"i"]; [temparray addobject:@"j"]; [temparray addobject:@"k"]; [temparray addobject:@"l"]; [temparray addobject:@"m"]; [temparray addobject:@"n"]; [temparray addobject:@"o"]; [temparray addobject:@"p"]; [temparray addobject:@"q"]; [temparray addobject:@"r"]; [temparray addobject:@"s"]; [temparray addobject:@"t"]; [temparray addobject:@"u"]; [temparray addobject:@"v"]; [temparray addobject:@"w"]; [temparray addobject:@"x"]; [temparray addobject:@"y"]; [temparray addobject:@"z"];  return temparray; } 

any appreciated.

sam

you should returning autoreleased object:

return [temparray autorelease]; 

Comments

Popular posts from this blog

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -

openssl - Load PKCS#8 binary key into Ruby -