Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
December 16, 2017, 06:01:56 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register Chat  
Pages: [1]   Go Down
  Print  
Author Topic: Exerise 3-7  (Read 8485 times)
星如雨
Newbie
*
Posts: 14


Email
« on: April 04, 2014, 06:38:24 AM »

#import <Foundation/Foundation.h>

@interface XYPoint : NSObject

- (void) setXPointer: (int) x;
- (void) setYPointer: (int) y;
- (void) setZPointer: (int) z;
- (int) XPointer;
- (int) YPointer;
- (int) ZPointer;

@end

@implementation XYPoint
{
    int XPointer;
    int YPointer;
    int ZPointer;
}
- (void) setXPointer: (int) x {
    XPointer = x;
}
- (void) setYPointer:(int)y {
    YPointer = y;
}
- (void) setZPointer:(int)z {
    ZPointer = z;
}
- (int) XPointer {
    return XPointer;
}
- (int) YPointer {
    return YPointer;
}
- (int) ZPointer {
    return ZPointer;
}

@end

int main(int argc, const char * argv[])
{
   
    @autoreleasepool {
       
        // insert code here...
        XYPoint *myPointer = [[XYPoint alloc]init];
       
        [myPointer setXPointer:100];
        [myPointer setYPointer:200];
        [myPointer setZPointer:300];
        NSLog(@"My global pointer is at (%i, %i, %i)", [myPointer XPointer], [myPointer YPointer], [myPointer ZPointer]);
    }
    return 0;
}
Logged
Jeosdone
Newbie
*
Posts: 2


Email
« Reply #1 on: September 01, 2015, 03:49:10 AM »

I like to learn different significantly.
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents ゥ 2009 classroomM.com. All rights reserved.