1.iOS開發(fā)相關(guān)尺寸
(1)應(yīng)用商城圖片和視頻尺寸
? ? 圖片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)開發(fā)尺寸
? ? 375X667
? ? 414X736
? ? 375X812
? ? 320X568
? ? 320X480
? ?iPhone X/Xs375X812
? ? iPhone XR414X896
? ? iPhone XsMax414X896
(3)APP圖標(biāo)尺寸
? ? ? 1024X1024 40X40 60X60 58X58 87X87 120X120 180X180
2.使用GPX文件改版模擬器的地址
添加GPX文件在Xcode:Edit Scheme -->?Options -->?Default Location -->?Add GPX File to Project
百度網(wǎng)盤下載GPX文件只需要改對應(yīng)的經(jīng)緯度就可以使用:?
shengzhen.gpx_免費高速下載|百度網(wǎng)盤-分享無限制
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.字符串和數(shù)組轉(zhuǎn)換
//字符串轉(zhuǎn)變?yōu)閿?shù)組1
NSMutableString* str=[[NSMutableString alloc] initWithFormat:@"1,1,1,1,1,1"];
//字符串轉(zhuǎn)變?yōu)閿?shù)組2
NSMutableArray* array=[NSMutable ArrayarrayWithArray:[str?? componentsSeparatedByString:@","]];
//替換數(shù)組中的某個值
[array replaceObjectAtIndex:4 withObject:@"2"];
//把數(shù)組轉(zhuǎn)換成字符串
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
{
? ? // 業(yè)務(wù)邏輯
}
@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.
執(zhí)行命令,卸載
$ 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