Xcode intents are screwy

When ever I'm making a switch statement in Xcode... everything indents incorrectly (see below)



public class cootieOut{
public void play(){
boolean head=false, body=false, tail=false;
int leg=0, antenna=0, eye=0, roll;
InputBox in = new InputBox();
DrawingBox box = new DrawingBox();
box.setDrawableSize(300,150);
in.setPrompt("Enter the roll: ");
do{
roll=in.readInt();
switch(roll){
case 1:
body = true;
case 2:
if(body)
head= true;
case 3:
if(body){
if(leg<6){
leg++;
}
}
}
}
}
}

PowerMac G5, Mac OS X (10.4.4)

Posted on Apr 24, 2006 5:18 PM

Reply
2 replies

Apr 24, 2006 8:48 PM in response to Marcin Owczarczyk

Hi,

I created a new file named "untitled.h" and I pasted in the code that you posted, and it indented fine. To check on your indentation settings, select "Preferences" from the XCode menu, Click on the "Indentation" icon at the top of the "Preferences". In my installation, I had "Insert 'tabs' instead of spaces" checked, with a Tab width of 4 and an Indent width of 4. Line wrapping was unchecked, and "Syntax-aware indenting" is checked, with "Tab indents" having the value of "In leading white space". All of the checkboxes in the "Automatically indented characters" and "// comments" are checked.

Hope this helps.

Ken

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Xcode intents are screwy

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.