原创 iOS區分各種設備

if([ [ UIDevice currentDevice ] userInterfaceIdiom ] == UIUserInterfaceIdi

原创 .DS.Store隱藏文件丟失

解決方法:把丟失的文件.DS.Store(文件中顯示是紅色的,無效的)刪除,然後重新拉入該文件,使用git 遇到的問題

原创 移動UICollectionViewCell

- (void)handlelongGesture:(UILongPressGestureRecognizer *)longGesture {  

原创 AFHTTPSessionManager隨機生成boundary

    NSString * boundary = [NSString stringWithFormat:@"%@%08X%08X",exStr,arc4random(),arc4random()]; exStr是你們後臺上傳圖片

原创 Terminating app due to uncaught exception 'Cannot Install Constraint', reason: 'No common superview

先把控件addSubviews上 然後再拉約束,如下  let imageView = UIImageView.init()                  imageView.image = UIImage(named: "c

原创 401錯誤

401一般是未登錄,需要進行認證   //401 設置用戶名和密碼 認證     NSString * user = [userDefaults objectForKey:@"employeeNumber"];          NSSt

原创 button上多一塊藍色

 解決方法 使用自定義custom而不是系統的

原创 Attempt to set a non-property-list object

原因是使用NSUserDefaults 保存了自定義的類 不能保存自定義的類只能是基本數據類型 NSArray NSString NSNumber NSDictionary等等 不過你可以使用NSData轉換,這個很麻煩,還不如使用Cor

原创 UISearchBar的placeholder文字上移問題

//    NSMutableParagraphStyle * style = [self.searchTF.defaultTextAttribut

原创 設置導航欄透明

  [self.navigationController.navigationBar setBackgroundImage:[UIImage new

原创 UIWebView讀取Gif圖 swift

 let file = NSBundle.mainBundle().pathForResource("voicegif", ofType: "gif")                  if file != nil {    

原创 XXX is busy: Processing symbol files

This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and

原创 SDWebImage加載圖片設置cookie

       WeakSelf;              [SDWebImageDownloader.sharedDownloader downloadImageWithURL:url options:SDWebImageDow

原创 302解決

302暫時性轉移 我的解決方法是網絡請求沒有設置cookies,設置一下就好了

原创 字符串NSString轉NSDate

 NSString * dateStr = @"2015-08-31 12:00:50";          NSDateFormatter * formatter =[NSDateFormatter new];