Regarding Debugging in Xcode

Posted by user185590 on Stack Overflow See other posts from Stack Overflow or by user185590
Published on 2009-10-20T09:24:37Z Indexed on 2010/04/17 2:03 UTC
Read the original article Hit count: 293

Filed under:
#import <Foundation/Foundation.h>

@interface ClassA : NSObject

{
    int x;  
}

-(void) initVar;
@end

@implementation ClassA
-(void) initVar
{
    x = 100;
}

@end

@interface ClassB : ClassA
{
    int y;
}

-(void) initVar;
-(void) printVar;

@end

@implementation ClassB
-(void) initVar
{ 
    x = 200;
    y = 300;
}

- (void) printVar
{
    NSLog(@"x= %i", x );
    NSLog(@"y= %i", y);
}

@end

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    ClassB * b = [[ClassB alloc] init];
    [b initVar];
    [b printVar];
    [b release];
    [pool drain];

    return 0;
}

© Stack Overflow or respective owner

Related posts about xcode