Variables renaming themselves

I have a weird situation going on. I’m working on an XCode project and have a variable named “cupsize” (it’s not what you think:P). I want to change the spelling to “cupSize” but when I compile it always reverts to “cupsize”. I’ve done a find and replace (it only occurs once) and even cleaned the project but to no avail. Anyone?

Jim Neumann

Hi :slight_smile:

  1. Quit XCode…
  2. Launch Script Editor application and open your AS-S script file
  3. Find “cupsize” and replace all with “cupSize”, without “Ignoring case”
  4. Save changes and close script file
  5. Launche XCode and open your AS-S project


You can also bypass using script editor and just use Xcode. Change all occurrences of the undesirable variable name to something totally different… for example, change all instances of “cupsize” to “waistsize”… unless you’re already using that too. :wink: Using ‘find/replace all’ works well for this if you have lots of existing occurrences of the variable. Then, quit Xcode. Restart Xcode, and you’ll then be able to change it to “cupSize”. It’s the action of restarting Xcode that allows it to forget the variable case, but you must be sure that you’ve gotten ALL instances before restarting.


:stuck_out_tongue: I knew that variable name was going to cause me trouble ! :stuck_out_tongue: I actually work in the art department of a foam cup manufacturing company and have scripts to do things based on the size of the cup, hence cupSize. (Ok, I really like typing cupSize! :smiley: )

Thanks for the help you two.

Jim Neumann