1.// 去除多余的线
table.tableFooterView = [[UIView alloc]initWithFrame:CGRectZero];
2.// 手机号中间四位为*号
NSString * telStr = [NSString stringWithFormat:@"%@",am.mobilePhoneNum];
NSString * str1 = [telStr stringByReplacingCharactersInRange:NSMakeRange(3, 4) withString:@"****"];
_telNumLabel2.text = str1;
3.// cell右边加箭头
cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
4.
#define RGBCOLOR(r, g, b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]
#define RGBACOLOR(r, g, b, a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]
//弧度转度数
#define RADIANS_TO_DEGREES(x) ((x)/M_PI*180.0)
//度数转弧度
#define DEGREES_TO_RADIANS(x) ((x)/180.0*M_PI)
5.1 iOS9新AlertView
UIAlertController * alert = [UIAlertController alertControllerWithTitle:@"系统信息" message:@"保存成功" preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
}]];
[self presentViewController:alert animated:YES completion:nil];
5.2
NSString *title = NSLocalizedString(@"提示", nil);
NSString *message = NSLocalizedString(@"这是一个提示", nil);
NSString *cancelButtonTitle = NSLocalizedString(@"取消", nil);
NSString *otherButtonTitle = NSLocalizedString(@"确定", nil);
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:cancelButtonTitle style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
NSLog(@"点击了取消按钮.");
}];
UIAlertAction *otherAction = [UIAlertAction actionWithTitle:otherButtonTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
NSLog(@"点击了确定按钮.");
}];
[alertController addAction:cancelAction];
[alertController addAction:otherAction];
[self presentViewController:alertController animated:YES completion:nil];
//应尽量用自己定义的类
-(void)customAlertView:(NSString *)subStr mainStr:(NSString *)mainStr confirmStr:(NSString *)confirmStr cancelStr:(NSString *)cancelStr{
UIAlertController * alert = [UIAlertController alertControllerWithTitle:subStr message:mainStr preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:confirmStr style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"确定");
}]];
[alert addAction:[UIAlertAction actionWithTitle:cancelStr style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"取消");
}]];
[self presentViewController:alert animated:YES completion:nil];
}
- tableview点击cell跳转到storyboard中搭建界面同时有h,m方法的类
UIStoryboard * story = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController * vc = [story instantiateViewControllerWithIdentifier:@"justTest"];
[self presentViewController:vc animated:YES completion:nil];
7.得到控件的高
CGRectGetHeight(_tableView.frame)
8.#warning 下面的修改button文字颜色
// _noWifiButton.titleLabel.textColor = [UIColor blackColor];
[_noWifiButton setTitleColor:[UIColor darkGrayColor] forState:0];