原创 瀑布流

- (UICollectionView *)collectionView {    if (!_collectionView) {        _collectionView = [[UICollectionView alloc] ini

原创 CALayer的用法

 UIView *view = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];    view.backgroundColor = [UIColor redCol

原创 本地通知

//本地通知,只有程序處於非運行狀態,纔會出發本地通知        //1.創建本地通知的對象    UILocalNotification *notification = [[UILocalNotification alloc] ini

原创 OC語言中數組的使用

數組和可變數組的基本用法 NSString *st1 = @"158";        NSString *str2 = @"39";        int a = [st1 intValue];        int b = [str2

原创 獲取相冊

UIAlertController *alertCtrl = [UIAlertController alertControllerWithTitle:@"提示" message:nil preferredStyle:UIAlertContr

原创 OC語言中字符串的使用

可變字符串        //插入字符串        NSMutableString *string1 =[NSMutableString stringWithString:@"字符串"];        [string1 insertS

原创 同步網絡通信步驟

 //同步網絡通信    //1.構建URL地址    NSURL *url = [NSURL URLWithString:@"http://piao.163.com/m/cinema/list.html?app_id=1&mobileTy

原创 C語言中謂詞的用法

 NSArray *persons = @[jack, tom, rose, lucy, bob, john, lily];        //指定謂詞條件    NSPredicate *pre1 = [NSPredicate predi

原创 OC語言字典的使用

//字典     //初始化一個字典        //注意:字典中所裝的數據類型:對象類型,不可以是基本數據類型        //字典是無序的        //key通常是字符串, key必須唯一        NSDictionar

原创 UI中視頻的使用

MPMoviePlayerController的用法(簡單用法)//添加通知    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fini

原创 本地通知

//本地通知,只有程序處於非運行狀態,纔會出發本地通知        //1.創建本地通知的對象    UILocalNotification *notification = [[UILocalNotification alloc] ini

原创 地圖位置信息

//創建位置服務對象    locationManager = [[CLLocationManager alloc] init];        locationManager.desiredAccuracy = kCLLocationAc

原创 OC語言中NSDate的用法

    OC語言中NSDate的用法//獲取當前系統時間   標準時間 GMT 格林尼治時間        NSDate *date = [NSDate date];        NSLog(@"date is %@", date);