Nishi
Nishi

Reputation: 703

Getting memory leaks in my iPhone application project how should I resolve it?

I am getting memory leaks in one of the method which I used in my iOS project. I am not able to find out what is happening as I am new in iOS development.

http://screencast.com/t/y2lOtssY2NjO

Upvotes: 1

Views: 65

Answers (3)

AppleDelegate
AppleDelegate

Reputation: 4249

The static analyser is pointing out the leak on UIAlertView .Initialize the alertView only once.

UIAlertView *alert = [[UIAlertView alloc]initWithTitle:str.....and so on

Upvotes: 1

Midhun MP
Midhun MP

Reputation: 107121

You are calling init twice on your alertView. I think that makes the issue.

Change that like:

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:str message:kAlertMessage delegate:self cancelButtonTitle:nil otherButtonTitles:@"Install now", @"Cancel", nil];

Please refer this question : What happens if i call init more than once

Upvotes: 4

SachinVsSachin
SachinVsSachin

Reputation: 6427

You can find via instrument here is tutorial for click here that will tell you or Xcode->product->analyze

Upvotes: 0

Related Questions