Renaming a Class.

Discussion in 'iPhone/iPad Programming' started by larswik, Mar 2, 2012.

  1. macrumors 65816

    Joined:
    Sep 8, 2006
    Messages:
    1,494
    #1
    HI, In a hurry the other day I was not paying attention when I created a new Class and it started out with a lower case instead of upper case letter. Is it as simple as just editing the name of the Class to correct this?

    I ask because a while back I deleted a Class by mistake and even after reconstructing that header file it always gave me errors. So before I try to attempt to just rename this one I thought I would ask.

    Thanks.
     
  2. macrumors newbie

    stirfie

    Joined:
    Feb 11, 2012
    Messages:
    7
    Location:
    Western Australia
    #2
    You need to refactor the class.

    Go the help file in xcode and look up refactor, there are a few options there, one of them is for renaming the class.
     
  3. macrumors 65816

    Joined:
    Sep 8, 2006
    Messages:
    1,494
    #3
    I am glad I asked.

    Thanks!
     
  4. macrumors 68040

    Joined:
    Apr 22, 2005
    Messages:
    3,528
    #4
    Generally speaking there is nothing wrong with just renaming the class as long as you make sure to change all instances of it. You'd probably want to rename the files, too. I assume Xcode's rename refactoring just automates this.
     

Share This Page