What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 130 Stack Exchange communities.

When I put objective-c code into stackoverflow (with the code tags) It will displayed almost without any readable format.

share|improve this question
1  
How are you formatting the code sections? Do you precede each line with 4 spaces or use the "code" icon (101010) to format it? –  ChrisF Oct 15 '10 at 11:33

1 Answer 1

up vote 2 down vote accepted

Code-tag:

import

@interface Fraction: NSObject { int numerator; int denominator; }

-(void) print; -(void) setNumerator: (int) n; -(void) setDenominator: (int) d; -(int) numerator; -(int) denominator; @end

versus

4 spaces indentation:

#import <Foundation/NSObject.h>

@interface Fraction: NSObject {
    int numerator;
    int denominator;
}

-(void) print;
-(void) setNumerator: (int) n;
-(void) setDenominator: (int) d;
-(int) numerator;
-(int) denominator;
@end
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .