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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.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 10-06-2008, 05:44 PM   #1 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 1
Default Memory leaking.

Code:
- (void)addVenueToList:(Venue *)inVenue
{
	[self.venueList addObject:inVenue];
			
	NSLog(@"Venue List Count : %d", [self.venueList count]);
}
I cannot figure it out. Venue list is a mutable array. I'm passing an object and putting directly into the array and it doesn't want to make me happy.

Help me please.
SageAMDP is offline   Reply With Quote
Old 10-06-2008, 06:06 PM   #2 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 88
Default

Why do you think that is leaking memory?
nacht is offline   Reply With Quote
Old 10-06-2008, 10:52 PM   #3 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 211
Default

addObject increments the retain count.

Either release the object or don't add it to the list.
lapse is offline   Reply With Quote
Old 10-06-2008, 11:22 PM   #4 (permalink)
New Member
 
Join Date: Apr 2008
Posts: 420
Send a message via AIM to jeff_lamarche Send a message via Yahoo to jeff_lamarche
Default

If you're having a problem, it's not in this code. venueList will retain the object you add to it, and if you remove it later, it will release it, so this method looks cool. Your problem is elsewhere. You might want to post more specifics, such as the error message. I think this method is a red herring.
__________________
Check out my iPhone Dev Blog
You can send me e-mail at my forum username at mac dot com.
jeff_lamarche is offline   Reply With Quote
Reply

Bookmarks

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: 265
22 members and 243 guests
@sandris, AdamL, ADY, Dani77, diyora, FAED, fredidf, F_Bryant, GHuebner, HDshot, headkaze, mer10, Oral B, prchn4christ, Rudy, smithdale87, stekki, tgjorgoski, Thompson22, Touchmint, twerner, vigu360
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,752
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

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