Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-08-2010, 09:45 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2010
Location: MA
Posts: 126
nd049 is on a distinguished road
Exclamation Potential leak of an object?

I just built analyzed the app I am working on, and in one section of the code it says "Potential leak of an object allocated on line 79" which is:

Code:
[shows addObject:[item copy]];
item is a NSMutableDictionary and shows is a NSMutableArray. Both of these variables I release in dealloc at the end so I am confused as why there would be a leak. Before line 79 i have:

Code:
if ([elementName isEqualToString:@"item"]) {
		// save values to an item, then store that item
		[item setObject:currentTitle forKey:@"title"];
		[item setObject:currentDate forKey:@"date"];
		[item setObject:currentTime forKey:@"time"];
		[item setObject:currentPrice forKey:@"price"];
		[item setObject:currentAddress forKey:@"address"];
		[item setObject:currentLatitude forKey:@"lat"]; 
		[item setObject:currentLongitude forKey:@"lon"];
Any help would be very appreciated!
nd049 is offline   Reply With Quote
Old 03-08-2010, 09:55 AM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

you do not need the "item copy", just remove the copy part
smithdale87 is offline   Reply With Quote
Old 03-08-2010, 10:06 AM   #3 (permalink)
Registered Member
 
Join Date: Jan 2010
Location: MA
Posts: 126
nd049 is on a distinguished road
Default

Quote:
Originally Posted by smithdale87 View Post
you do not need the "item copy", just remove the copy part
Thanks! That fixed it.
nd049 is offline   Reply With Quote
Old 03-08-2010, 10:09 AM   #4 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

welcome
smithdale87 is offline   Reply With Quote
Reply

Bookmarks

Tags
leak

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 345
10 members and 335 guests
2Apps1Day, akacaj, c2matrix, esoteric, givensur, HemiMG, mjnafjke, Pudding, SLIC, Techgirl-52
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,650
Threads: 94,115
Posts: 402,887
Top Poster: BrianSlick (7,990)
Welcome to our newest member, soohyun
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:11 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0