Renaming a Class.

Discussion in 'iOS Programming' started by larswik, Mar 2, 2012.

  1. macrumors 68000

    Sep 8, 2006
    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.

  2. macrumors newbie


    Feb 11, 2012
    Western Australia
    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. thread starter macrumors 68000

    Sep 8, 2006
  4. macrumors 68040

    Apr 22, 2005
    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