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 01-18-2011, 05:05 PM   #26 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 54
jcww33 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Leaks don't cause crashes. Crashes (assuming a memory-related issue) will be due to (at least) one of the following:

1. Something is over-released

2. Something is under-retained

I already stated this before.

Don't just go around blindly slapping autoreleases on things. You potentially cause more problems, or make existing problems worse.

Also, it's possible that you have fixed the parser, and now have problems in the rest of your app.
Well, I removed the autorelease since it caused the crash (probably over releasing) and still when I type a character in the search bar, it crashes. I added other code to the app but nothing major.
jcww33 is offline   Reply With Quote
Old 01-18-2011, 05:17 PM   #27 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 54
jcww33 is on a distinguished road
Default

Well, I removed the autorelease since it caused the crash (probably over releasing) and still when I type a character in the search bar, it crashes. I added other code to the app but nothing major.
jcww33 is offline   Reply With Quote
Old 01-18-2011, 05:27 PM   #28 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 54
jcww33 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Leaks don't cause crashes. Crashes (assuming a memory-related issue) will be due to (at least) one of the following:

1. Something is over-released

2. Something is under-retained

I already stated this before.

Don't just go around blindly slapping autoreleases on things. You potentially cause more problems, or make existing problems worse.

Also, it's possible that you have fixed the parser, and now have problems in the rest of your app.
Well, I removed the autorelease since it caused the crash (probably over releasing) and still when I type a character in the search bar, it crashes. I added other code to the app but nothing major.
jcww33 is offline   Reply With Quote
Old 01-18-2011, 05:29 PM   #29 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 54
jcww33 is on a distinguished road
Default

Sorry... I did not mean to post that 3 times
jcww33 is offline   Reply With Quote
Old 01-20-2011, 06:05 PM   #30 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 54
jcww33 is on a distinguished road
Default

Made some progress. Their are still leaks coming from the parser didStartElement, along with the parser didEndElement. These two lines of code seem to leak in the parser didEndElement:

Code:
[item setObject:self.currentTitle forKey:@"title"];
[items addObject:item];
Along with the connectionDidFinishLoading which has issues with
Code:
[rssParser parse];
I have no clue what is wrong with the parser didStartElement
jcww33 is offline   Reply With Quote
Old 01-20-2011, 06:11 PM   #31 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

None of those lines alone are leaks.

Although, you probably don't want to put currentTitle directly into the dictionary. It's a mutable string, which means it can be changed. You'll only wind up with the very last value it had, across each of your dictionaries. You should copy it first, and then it would be something that should be released.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 01-21-2011, 08:00 AM   #32 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 54
jcww33 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
None of those lines alone are leaks.

Although, you probably don't want to put currentTitle directly into the dictionary. It's a mutable string, which means it can be changed. You'll only wind up with the very last value it had, across each of your dictionaries. You should copy it first, and then it would be something that should be released.
I just realized this but the console says "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary rangeOfStringptions:]: unrecognized selector sent to instance 0x66586d0" But what do you mean by copy it first?
jcww33 is offline   Reply With Quote
Old 01-21-2011, 08:03 AM   #33 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

My guess is that's coming from the search routine. Either you are not searching against the right kind of object, or you still have a memory issue.

Code:
NSString *anotherString = [aString copy];
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 02-02-2011, 11:43 AM   #34 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 54
jcww33 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
My guess is that's coming from the search routine. Either you are not searching against the right kind of object, or you still have a memory issue.

Code:
NSString *anotherString = [aString copy];
I am still confused on how/why copying the string would help with memory? Can you explain? Thanks so much.
jcww33 is offline   Reply With Quote
Old 02-02-2011, 11:58 AM   #35 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

I don't seem to recall stating that copying would help with memory.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 02-02-2011, 12:53 PM   #36 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 54
jcww33 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
My guess is that's coming from the search routine. Either you are not searching against the right kind of object, or you still have a memory issue.

Code:
NSString *anotherString = [aString copy];
Sorry, I must have misinterpreted that. But still how does that help. I am also confused on how to copy it. You gave me the code (thank you) however what do I do with the variable another string (or am I misinterpreting that to)?
jcww33 is offline   Reply With Quote
Old 02-02-2011, 12:59 PM   #37 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Copying is to make sure you get the right value. With a mutable string, since the value can change, each time you change the mutable string, the value will change in all places. So once you get this up and running correctly, you would find that all of your parsed objects only have the very last value. Copying the string makes sure you capture the value at that time.

Don't worry about it for now. Get the parser working first.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 02-02-2011, 02:53 PM   #38 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 54
jcww33 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Copying is to make sure you get the right value. With a mutable string, since the value can change, each time you change the mutable string, the value will change in all places. So once you get this up and running correctly, you would find that all of your parsed objects only have the very last value. Copying the string makes sure you capture the value at that time.

Don't worry about it for now. Get the parser working first.
I made more progress. Finding/fixing is actually kinda fun and definitely feels good when completed. I got rid of the leak on
Code:
NSXMLParser *rssParser = [[[NSXMLParser alloc] initWithData:responseData] autorelease];
but their is still a leak in
Code:
[rssParser parse];
which is probably caused by
Code:
[rssParser setDelegate:self];
plus this is still leaking:
Code:
self.items = [[[NSMutableArray alloc] init] autorelease];
but that's minor

Last edited by jcww33; 02-02-2011 at 04:59 PM.
jcww33 is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone, search, tableview

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: 365
7 members and 358 guests
blueorb, fredidf, iAppDeveloper, iGamesDev, mottdog, sacha1996, Touchmint
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,667
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, host number one
Powered by vBadvanced CMPS v3.1.0

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