原创 UITableViewDataSource和UITableViewDelegate內常用的13個方法
@protocol UITableViewDataSource<NSObject> @required //設置分組的行數 - (NSInteger)tableView:(UITableView *)tableView numberOfR
原创 this class is not key value coding-compliant for the key btn
使用xib創建button時,出現的錯誤,原因是這個button留接口時,第次出錯,就刪除了,重新命名了,造成第一次的命名的名字還連線使用.(重複連線,有多餘的連線) 解決辦法:把第一次btn的連線刪除就可以了.(僅供參考)
原创 iOS UITextField用法大全
UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 130, 30)]; //初始化textfield並設置位置及大小 text.borde
原创 調去系統照相機或者從本地相冊獲取圖片.
1.首先要遵守三個協議 UIActionSheetDelegate,UINavigationControllerDelegate,UIImagePickerControllerDelegate 2.主要代碼 //選擇頭像 -
原创 iOS App Development 第一個選項呈灰色不能選問題.
第一次整真機測試,啥都不懂,看了網上的教程,跟着一步一步走,到如上圖片所示這一步,就跟網上的不一樣了.成灰色狀態,不能勾選,那叫一個急,搜資料才知道問題. 解決辦法:把已經創建好的證書revoke一個就行了,證書最多好像3個,成灰色說明
原创 使用cocoaPods出現:incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)
使用cocoaPods安裝AFNetworking時出現: incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError) 原因是
原创 implicit conversion loses integer precision :'long' to 'int'
Xcode升級以後,打開以前的代碼出現了這個錯誤; 解決的辦法::依據自己的具體情況,進行強制類型轉換. 點贊 收藏 分享 文章舉報 duoduo_333 發佈了92 篇原創文
原创 iOS將輸入框的文字存入本地文件中
UITextField *tf = (UITextField *)[self.view viewWithTag:1000]; NSString *content = tf.text; //(1)獲取文件夾路徑 NS
原创 incompatible pointer types assigning to 'nsmutablearray ' from 'nsarray '
這是因爲NSMutableArray和NSArray不是同一個類型造成的. 解決方法 // NSArray --> NSMutableArray NSMutableArray *myMutableArray = [myArray mu
原创 An error was encountered while running (Domain = FBSOpenApplicationErrorDomain, Code = 4)
這個問題解決辦法: 1.重啓iOS模擬器 2.[iOS Simulator] >>> [Rest Contents and Settings...] >>> [Reset] 點贊 收藏 分享
原创 iOS模態切換視圖的四種不同風格
typedef NS_ENUM(NSInteger, UIModalTransitionStyle) { UIModalTransitionStyleCoverVertical =0,//從下向上出現 UIModalT
原创 cocoaPods的安裝和使用
打開終端按下面步驟: 1.移除ruby的原地址gem sources --remove https://rubygems.org/2.添加ruby的原地址gem sources -a http://ruby.taobao.org/3.查看
原创 iOS打電話的兩種方法
第一種方式 NSString *phone = @“88888888” if (phone != nil) { NSString *telUrl = [NSString stringWith
原创 -boundingRectWithSize:options:attributes:context:用法
導入第三方一些類庫後,出現一些警告就是某些方法被棄用了: 如: - (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(NSL
原创 下拉放大效果
static CGFloat headerHeight = 250; static CGFloat headerWidth = 320; - (void)scrollViewDidScroll:(UIScrollView *)scr