Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

onikage

macrumors newbie
Original poster
Jul 9, 2010
2
0
Hello,

I am new to iPhone development and came across an issue. I have a Date Picker control added to my xib in Interface Builder. It is set to Date and Time tumblers.

I noticed that when I ran my app through Instruments testing for leaks it had 1 leak discovered, in NSDateComponents.

I started a completely new View project with absolutely nothing else added except a date picker in IB. Testing in Instruments still yielded 1 leak in NSDateComponents. A friend, who originally discovered this problem in his app, is having the same issue.

This issue doesn't seem to occur when the control is not in Date AND Time mode.

Basically we are interested in knowing if we are not using the Date Picker correctly (e.g. forgetting to implement some required method/delegate stuff) or if this is a problem in the SDK. I'm leaning toward the former since I think of the millions of apps out there someone would have had to encounter the same issue and google didn't find anything so it must be our fault.

Thanks!
 

themoonisdown09

macrumors 601
Nov 19, 2007
4,319
18
Georgia, USA
I'm also building an iPhone app that uses the UIDatePicker in the Date and Time mode and Instruments is picking up a lot of leaks too. Not really sure what that means. :confused:
 

themoonisdown09

macrumors 601
Nov 19, 2007
4,319
18
Georgia, USA
After hours of looking over my code, I still can't figure out why the UIDatePicker is causing a memory leak. I copied my code for the way my UIDatePicker works using Apple's sample application called "DateCell".

I actually took the "DateCell" application and changed the mode to Date and Time (in the sample it's set to just Date) and sure enough, a memory leak shows up.

If someone more experienced in this can test this out to see if we're doing this wrong or what, that would be awesome.


Edit: Something else I've noticed is that every time the month is changed, more leaks appear. For example, if the UIDatePicker is currently set to July 12 and I scroll the picker to have August 4 selected, another memory leak pops up. If I change it back to July 12, yet another memory leak pops up. I'm getting really frustrated now!

Also, I am not listening to the Value Changed event.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
I haven't seen this but I'm pretty sure this has also been reported on the Apple iPhone forum. So it's probably a bug in the OS library.
 

onikage

macrumors newbie
Original poster
Jul 9, 2010
2
0
I haven't seen this but I'm pretty sure this has also been reported on the Apple iPhone forum. So it's probably a bug in the OS library.

Thanks Phoney, but do you have a link? I tried Google, but I don't think I'm getting the right ones to come up.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.