Created
May 28, 2015 11:50
-
-
Save zerho/e083034368dc25d24cf6 to your computer and use it in GitHub Desktop.
a simple example of how you write stuff from java to ObjectiveC
This file contains hidden or 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
Persona p = new Persona(); | |
Persona * p = [[Persona alloc] init]; | |
Persona p = new Persona("Matteo"); | |
Persona * p = [[Persona alloc] initWithName:@"Matteo"]; | |
Persona p = new Persona("Matteo","M"); | |
Persona * p = [[Persona alloc] initWithName:@"Matteo" | |
andSex:@"M"]; | |
obj.sendMail(mail,body); // JAVA | |
[obj sendMailTo:mail withMessage:body]; // OBJ-C | |
[ciao isEqual:pass] | |
// Any Controller | |
[p1 isEqual:p2] | |
// Class Persona | |
- (BOOL)isEqual:(id)object { | |
if([object isKindOfClass:Persona]) { | |
Persona *compare = (Persona*) object; | |
if( [self.cf isEqual:compare.cf] && | |
[self.birth isEqual:compare.birth] ){ | |
return YES; | |
} else | |
return NO; | |
} | |
else | |
return NO; | |
} | |
NSObject *obj; | |
UIButton *btn = [[UIButton alloc] initWithName:@"ciao"]; | |
// Array | |
Persone[] array = {p1,p2}; | |
NSArray * array = @[p1, m2, c3]; | |
anArray[0] | |
[anArray objectAtIndex:0]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment