原创 NSFileManager的簡介和使用
通過使用NSFileManager類來管理和操作文件、目錄,NSFileManager,文件或目錄是使用文件的路徑名的唯一標示。每個路徑名都是一個NSString對象。 NSFileManager對象通過defaultManager方法來
原创 NSData (用utf8創建數據和讀取數據)
NSData *data=[@"nihaoashdihahdo你好" dataUsingEncoding:NSUTF8StringEncoding]; NSLog(@"%@",data); 創建數據 NSS
原创 iOS nsdate
//獲取時間 NSDate *mydate=[NSDate date]; //創建時間格式 NSDateFormatter *mydateFormatter=[[NSDateFormatter alloc]init];
原创 NSNotification (通知)
- (void)viewDidLoad { [super viewDidLoad]; //創建一個通知中心 [[NSNotificationCenter defaultCenter]addObserver:self sel
原创 framebounds
tale=[[UITableView alloc]initWithFrame:self.view.frame]; [self.view addSubview:tale]; UIView *buttonv=[[UIVi
原创 iOS 自帶的高德地圖
#import "ViewController.h" #import "bubber.h" @interface ViewController (){ MKMapView *mymapview; CLLocation
原创 iOS UIImageView
//獲取本地圖片 UIImageView *imgV=[[UIImageView alloc]initWithFrame:self.view.frame]; UIImage *imge=[UIImage imageName
原创 NSMutableAttributedString(帶屬性的string)
mylabel=[[UILabel alloc]initWithFrame:CGRectMake(0, 50, 1000, 50)]; mylabel.backgroundColor=[UIColor brownColor];
原创 歸檔與解歸檔
/創建一個路徑 NSString *path=[NSHomeDirectory() stringByAppendingString:@"/Documents/haha.text"]; NSLog(@"%@",NSHomeD
原创 iOS 語音
#import "ViewController.h" #import <AVFoundation/AVSpeechSynthesis.h> @interface ViewController () @end @impl
原创 NSPredicate(謂詞)
簡述:Cocoa框架中的NSPredicate用於查詢,原理和用法都類似於SQL中的where,作用相當於數據庫的過濾取。 //謂詞使用 //小於條件 NSPredicate *mypredic=[NSPredicate
原创 UIAlertController
-(IBAction)hahah:(id)sender{ UIAlertController *alertc=[UIAlertController alertControllerWithTitle:@"網絡設置" mes
原创 UIPickerView(選擇框)
dic=@{@"xian":@[@"a",@"b",@"c"],@"hangzhou":@[@"d",@"e",@"f"],@"wuhan":@[@"g",@"h",@"z"]}; NSString *path=[[NSBundl
原创 UITabBarController
oneViewController *onev=[[oneViewController alloc]init]; UINavigationController *nav1=[[UINavigationController allo
原创 UIAlertView(警告提示)
-(IBAction)showPhonenum:(id)sender{ UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"請您檢測網絡" message:@"在手機設置裏