cocoa touch - When should i release this object? -


- (uiview *)pickerview:(uipickerview *)pickerview viewforrow:(nsinteger)row forcomponent:(nsinteger)component reusingview:(uiview *)view {      cgrect imageframe = cgrectmake(0.0, 0.0, 15, 15);     uiimageview *label = [[uiimageview alloc] initwithframe:imageframe];      if (row == 0)     {         label.backgroundcolor = [uicolor redcolor];     }     if (row == 1)     {         label.backgroundcolor = [uicolor bluecolor];     }     if (row == 2)     {         label.backgroundcolor = [uicolor blackcolor];     }        return label; } 

label leak. know it. but....

just [label autorelease]; before return


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -