开发者

iphone - how can I get a leak with this alertView?

开发者 https://www.devze.com 2023-01-10 21:47 出处:网络
this is on the main code: NSString * title = NSLocalizedString(@\"myTitle\", @\"\"); NSString * cancelTitle = NSLocalizedString(@\"dismiss\", @\"\");

this is on the main code:

NSString * title = NSLocalizedString(@"myTitle", @"");
NSString * cancelTitle = NSLocalizedString(@"dismiss", @"");
NSString * otherTitle = NSLocalizedString(@"noMoreTips", @"");
NSString * message = NSLocalizedString(@"myMessage", @"");

[self ShowAlertBox: title : message : cancelTitle : otherTitle];

This is the method

- (void) ShowAlertBox: (NSString *) title : (NSString *) myMessage : (NSString *) cancelButton : (NSString *) otherButton {


UIAlertView * alertView = [[UIAlertView alloc]
               initWithTitle:title
               message:myMessage 
               delegate:self cancelButtonTitle:cancelButton
            otherButtonTitles:ot开发者_运维百科herButton, nil ];

[alertView show];
[alertView release];
}

I have also tried to remove the [alertView release] from here and put it inside

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex

without any success... it is still leaking!!

am I missing something?

thanks


There's no leak. It's likely a false positive.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号