- 一句代码解决UITableView 中的分割线顶格问题
self.tableView.separatorInset = UIEdgeInsetsZero;
- cd 项目路径/
- touch Podfile
- vim Podfile
inhibit_all_warnings!
platform:ios,'8.0'
use_frameworks!
target "项目名称" do
pod 'MJExtension'
end
- esc,:wq 保存退出
- pod install
self.autoresizingMask = UIViewAutoresizingNone;
- 这个间隔其实是一个被 UITableView 默认填充的 HeaderView。而且,视图的高度不能为0,否则完全不起效果。但我们用下面的代码创建一个高度特别小的 HeaderView 时,上面的边距就不见了
self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, CGFLOAT_MIN)];
- 跳转到苹果商店下载页面
NSString *str = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%d", app_id];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
- 跳转到苹果商店评论页面
NSString *str = [NSString stringWithFormat:@"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=%d&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8",app_id];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
[UIApplication sharedApplication].keyWindow.rootViewController;
代替
self.window.rootViewController
因为程序可能不止一个window,self.window可能不是主窗口;