开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜