Study Object-c, bought 2 books, of which 1 were bought with C money, general quality, comparative basis.
The other one is, crazy-Li Yang wrote, tome, more scary, compared to a whole bit.
For object-oriented, there is a general understanding, and then a few more basic examples.
At present, using the most unaccustomed is, there are multiple parameters of the method. This and the C-series language, very different, really uncomfortable ah.
Code
main.m// objectperson//// Created by fansunion on 15/12/3.// Copyright (c) 2015 demo. All rights reserved.//#import <Foundation/Foundation.h> #import "Person.h"//#import "person.m" int main (int argc, const char * argv[]) { @autoreleasepool { //Construction object person* person = [[Person alloc]init]; Invokes an instance method of 1 arguments [person say:@ "I am Fansunion"]; Call an instance method of 2 arguments [person setName: @ "Ray Fansunion" andage:26]; Call an instance method with no arguments [person info]; Call a class method without arguments [person bye]; } return 0;}
Run results
2015-12-03 20:57:39.023 objectperson[6193:440740] I am test method
2015-12-03 20:57:39.025 objectperson[6193:440740] hi,i am fansunion
2015-12-03 20:57:39.025 objectperson[6193:440740] I am Info method
2015-12-03 20:57:39.025 objectperson[6193:440740] Bye bye!
Program ended with exit code:0
The example is relatively simple.
We are off work today and continue tomorrow.
Object-c, objects and methods