Hi,
I'm new to the Instrument, i want to test how it detect the memory leak. So i use the following code. It gets fired when user click on a button.
-(IBAction)leak{
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 30, 30)]; NSLog(@"%@", button); button.selected = YES; }
but nothing happens in the Instrument. How come?
I changed the code to:
-(IBAction)leak{
NSMutableString *test = [[NSMutableString alloc] init]; [test appendString:@"Testing 1"]; [test appendString:@"\nTesting 2"]; NSLog(@"%@", test); }
And the Instrument tells me that there's a memory leak inside that code.
So why it can't detect the UIButton leak? Any comment will be appreciated!