Date Picker control leaks memory?

Discussion in 'iPhone/iPad Programming' started by onikage, Jul 9, 2010.

  1. macrumors newbie

    Joined:
    Jul 9, 2010
    #1
    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!
     
  2. macrumors 601

    themoonisdown09

    Joined:
    Nov 19, 2007
    Location:
    Georgia, USA
    #2
    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:
     
  3. macrumors 601

    themoonisdown09

    Joined:
    Nov 19, 2007
    Location:
    Georgia, USA
    #3
    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.
     
  4. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    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.
     
  5. macrumors 601

    themoonisdown09

    Joined:
    Nov 19, 2007
    Location:
    Georgia, USA
    #5
    My next question would be, will my app be rejected because of this memory leak?
     
  6. thread starter macrumors newbie

    Joined:
    Jul 9, 2010
    #6
    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.
     
  7. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #7

Share This Page