Welcome, Guest. Please login or register.
Did you miss your activation email?
April 30, 2017, 05:45:55 AM
Home Help Search chat Login Register 
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan

+ Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+ Programming in Objective-C, 4th edition
| |-+ Chapter 3
| | |-+ Exerise 3-7
Pages: [1] Go Down
Print
Author Topic: Exerise 3-7 (Read 7166 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

ทางเข้า maxbet

Pages: [1] Go Up
Print
Jump to:



Login with username, password and session length

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 (c) 2009 classroomM.com. All rights reserved.