Can I override documented private methods?

Discussion in 'iOS Programming' started by darthtroll, Jan 17, 2011.

  1. macrumors newbie

    Joined:
    Aug 24, 2010
    #1
  2. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    What makes you think that method is private? Seems awfully public to me, given that it's published in the class reference.
     
  3. thread starter macrumors newbie

    Joined:
    Aug 24, 2010
    #3
    Whoops...you're 100% right. I found an article talking about it and it had mentioned it was a private method. It must have been a typo. I should have been convinced otherwise after reading the documentation but I blame sleep deprivation!

    Thanks again dejo.
     
  4. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    As an answer to the generic question though I would say it's highly undesirable to do so for a couple of reasons:

    1) Apple may choose to make the method public in future
    2) Apple will, most likely, reject your app for using private methods as they scan for the method name
     
  5. thread starter macrumors newbie

    Joined:
    Aug 24, 2010
    #5
    Thanks robbieduncan, that was the general feeling I was getting. Fortunately for me that the method I needed was actually public, because there is no other way to do what I wanted to do.

    Thanks both of you,
    Darthtroll
     

Share This Page