1.iOS开发相关尺寸
(1)应用商城图片和视频尺寸
图片Screenshot:https://help.apple.com/app-store-connect/#/devd274dd925
6.5inch-display 1242x2688
5.8inch-display 1125x2436
5.5inch-display 1242x2208
4.7inch-display 750x1334
4inch-display 640x1136
3.5inch-display 640x960
视频APP preview:https://help.apple.com/app-store-connect/#/dev4e413fcb8
6.5inch-display 886x1920
5.8inch-display 886x1920
5.5inch-display 1080x1920
4.7inch-display 750x1334
4inch-display 640x1136
(2)开发尺寸
375X667
414X736
375X812
320X568
320X480
iPhone X/Xs375X812
iPhone XR414X896
iPhone XsMax414X896
(3)APP图标尺寸
1024X1024 40X40 60X60 58X58 87X87 120X120 180X180
2.使用GPX文件改版模拟器的地址
添加GPX文件在Xcode:Edit Scheme --> Options --> Default Location --> Add GPX File to Project
百度网盘下载GPX文件只需要改对应的经纬度就可以使用:
shengzhen.gpx_免费高速下载|百度网盘-分享无限制
3.收到通知后刷新界面视图
-(void)getrongcloadNC:(NSNotification*)userinfor{
[self performSelectorOnMainThread:@selector(refreshthenew)withObject:nilwaitUntilDone:YES];}
-(void)refreshthenew{
if(self.selectedIndex!=1) {
self.newchatmark.hidden= NO; }
else{
self.newchatmark.hidden= YES;}
}
4.字符串和数组转换
//字符串转变为数组1
NSMutableString* str=[[NSMutableString alloc] initWithFormat:@"1,1,1,1,1,1"];
//字符串转变为数组2
NSMutableArray* array=[NSMutable ArrayarrayWithArray:[str componentsSeparatedByString:@","]];
//替换数组中的某个值
[array replaceObjectAtIndex:4 withObject:@"2"];
//把数组转换成字符串
NSString*ns=[array componentsJoinedByString:@","];
5.显示和不显示mac隐藏属性的文件夹
warning:file is missing from working copy
SVN版本控制,删除的文件仍然存在于隐藏文件夹里面。
显示隐藏文件夹:
defaults write com.apple.finder AppleShowAllFiles -bool YES
不显示隐藏文件夹:
defaults write com.apple.finder AppleShowAllFiles -bool NO
注:删除源文件的.svn文件将会大大减小源文件
6.block传值
@property(nonatomic, strong)void(^selectCell)(ListUserModel *userModel);
self.selectCell(model);
searchRTVC.selectCell = ^(ListUserModel *userModel) {
[weakSelf showAlerViewtWith:userModel];
};
7.捕捉异常
@try
{
// 业务逻辑
}
@catch(异常类型名1ex)
{
//异常处理代码
}
@catch(异常类型名2ex)
{
//异常处理代码
}
// 可以捕捉 N 个 异常 ...
@finally
{
//回收资源
}
栗子
NSDictionary *paramer;
@try{
paramer =@{@"pageSize": [NSNumber numberWithInteger:pageSize],
@"page": [NSNumber numberWithInteger:page],@"masterUid":self.masterUid};
}@catch(NSException *exception){
return;
}@finally{
}
8.删除工程没有使用的冗余文件
GitHub - li6185377/ClearUnusedImage: 删除xcode项目中未使用的图片
9.Xcode插件管理器Alcatraz的安装
常用插件
BBUFullIssueNavigator Show all issueinthe issue navigator.
执行命令,卸载
$ rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin
$ rm -rf ~/Library/Application\ Support/Alcatraz/
重装
$ curl -fsSL https://raw.github.com/supermarin/Alcatraz/master/Scripts/install.sh|sh
$ sudo gem install update_xcode_plugins
$ update_xcode_plugins
$ update_xcode_plugins —unsign