標籤:xcode framework uitapgesturerecogniz nscharacterset
1. 鑰匙串中:紅色框中兩者之前一一對應,如果將Keys中private Key或者public Key刪除,那麼其對應的認證將無法使用(由於我不喜歡我的東西太亂,於是刪除了Keys中的一些東西,結果發現認證無法使用了,重新安裝都不好使,只好重新申請了一套認證)
圖
2. Xcode裡面沒有了Frameworks檔案夾,現在可以手動在添加(如,添加目錄不要錯,否則你添加的系統庫不會自動添加到該目錄下)
3. 自己手動建立Framework庫時,預設建立的是動態庫,如果你需要的是靜態庫,那麼需要手動修改“Mach-O Type”為Static Library
5. 判斷字串中是否沒有指定字串以外的字元NSCharacterSet*nameCharacters = [[NSCharacterSet characterSetWithCharactersInString:@"1234567890"]invertedSet];
NSRange range = [phoneNum rangeOfCharacterFromSet:nameCharacters];
if (range.location != NSNotFound) {
return NO; }
6. 解決 UITapGestureRecognizer 與 UITableView的 didSelectRowAtIndexPath衝突問題(重寫手勢的代理事件)- (BOOL)gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer shouldReceiveTouch:(UITouch*)touch {
// 若為UITableViewCellContentView(即點擊了tableViewCell),則不截獲Touch事件
if ([NSStringFromClass([touch.viewclass]) isEqualToString:@"UITableViewCellContentView"]) {
return NO;
}
return YES;}
7. : self.view.backgroundColor = [UIColor whiteColor]; UIView *rootView = [UIApplication sharedApplication].keyWindow.rootViewController.view; UIGraphicsBeginImageContextWithOptions(rootView.bounds.size, YES, 2); [rootView.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *uiImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();
8. 當你調用presentViewController方法,在視圖之間跳轉時,想要presented Viewcontroller是透明的,可以重寫
- (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion {
if ([[DEVICE systemVersion] floatValue] >=8.0) {
viewControllerToPresent.modalPresentationStyle =UIModalPresentationOverCurrentContext;
} else {
self.modalPresentationStyle =UIModalPresentationCurrentContext;
}
[superpresentViewController:viewControllerToPresentanimated:flag completion:completion];
}
著作權聲明:本文為博主原創文章,未經博主允許不得轉載。
iOS——開發周報(2015-07-31)