*關于跳轉
1:由Appdelegate類 首先確認登陸頁面為首先加載的界面。 利用模態(present...) 跳轉到主界面.
(ps: 不用壓棧 為了防止跳轉后的界面出現 UINavigationBar 和 UITabBar對象)
2:不包含navigationBar和tabBar界面的 登陸、注冊、忘記密碼等均不用壓棧(push..)。
*[iOS]tableView經常使用的到
//去掉多余的cell
self.contactsTableView.tableFooterView= [[UIViewalloc]initWithFrame:CGRectZero];
//tableView出現的時候,清除選中狀態
如果是tableViewController
self.clearsSelectionOnViewWillAppear = YES;
如果是viewController,在viewWillAppear方法里添加
[self.tableViewdeselectRowAtIndexPath:[self.contactsTableViewindexPathForSelectedRow]animated:YES];
*隱藏TextView中的“placeholder”。
1:新建一個Label(全局變量),添加
2:
一:
-(void)textViewDidChange:(UITextView*)textView
{
// self.examineText =? textView.text;
if(textView.text.length==0) {
_label.text=@"請填寫審批意見...";
}else{
_label.text=@"";
}
}
// 解決終端安裝插件,不彈出提醒的代碼(放在終端運行,Example:Alcatraz)
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add `defaults read /Applications/Xcode.app/Contents/Info.plist DVTPlugInCompatibilityUUID`