1. .m 文件里面的 @interface 作用
新建一个 HelloWorld 类,那么xcode创建2个文件:
HelloWorld.h 和 HelloWorld.m
HelloWorld.m里包括
@interface HelloWorld ()
@end这个是类别Category,如上所说放块中间放入的方法被当成private方法。
因为.m文件不像.h文件一样暴露到外部,所以.m文件中声明的方法外面并不知道,但是实际上还是可以调用的。
2.NSClassFromString(NSString *aClassName)
方法作用是根据字符串来寻找对应的类
3.
NSString *fileName = [NSHomeDirectory()stringByAppendingPathComponent:@"Desktop/demo.plist"];
[arr writeToFile:fileName atomically:YES];//写入到plist文件
NSArray *newArry = [NSArray arrayWithContentsOfFile:fileName];//读取plist文件
NSHomeDirectory 方法的作用是拿到用户根目录
stringByAppendingPathComponent 作用是追加一个路径
4.
[self presentViewController:svc animated:YES completion:nil]实现切换视图方法
[self.navigationController pushViewController:svc animated:YES];在导航里添加添加一个视图
5.
1. 所有的UI都继承自UIView,把ui放到界面上,addSubview;
2.设置他们的位置和大小,都用frame
3.如果能添加事件,addTarget: