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
Post a Comment