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