Created
October 5, 2013 02:47
-
-
Save toulouse/6836071 to your computer and use it in GitHub Desktop.
That's because you're doing it wrong
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@class X | |
@interface Y : NSObject | |
@property (nonatomic, assign) int z; | |
- (int)times:(int)other; | |
- (int)timesX:(X *)xObject; | |
@end | |
@implementation Y | |
- (int)times:(X *)xObject | |
{ | |
return self.z * xObject.zzz | |
} | |
@end | |
@interface X : NSObject | |
@property (nonatomic, strong) NSString *name; | |
@property (nonatomic, assign) int zzz; | |
@end; | |
int main() | |
{ | |
std::cout << "hello" << std:endl; | |
X *x = [[X alloc] init]; | |
x.zzz = 3; // alternatively, x->_zzz should work too I think, but that's an ivar access | |
Y *y = [[Y alloc] init]; | |
// ... etc | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment