tags:

views:

17

answers:

2

why is this piece of code showing a leak in the "Leaks" program?

    btnFaceBook = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    UIImage *faceBookImg = [UIImage imageNamed:@"facebook.gif"];
    [btnFaceBook setBackgroundImage:faceBookImg forState:UIControlStateNormal];

I'm not doing alloc on UIButton or on UIImage.

A: 

This code isn't leaking. The leak is in some other part of the code.

Jasarien
A: 

apparently, testing leaks on ipad simulator is not a good idea since it shows leaks that are not found on the device.

Joo Park