D15:網(wǎng)絡(luò)下載(NSURLConnection實現(xiàn)下載, 結(jié)合UITableView顯示)

網(wǎng)絡(luò)請求:

  1. http協(xié)議了解

  2. 客戶端發(fā)送請求信息(GET)

  3. 服務(wù)器根據(jù)網(wǎng)絡(luò)鏈接, 找到對應(yīng)的相應(yīng)方法, 去服務(wù)器的數(shù)據(jù)庫查找數(shù)據(jù)

  4. 客戶端就可以接收到返回的數(shù)據(jù),就可以處理數(shù)據(jù)

  5. JSON/XML處理數(shù)據(jù)

JSON/XML技術(shù): 手機開發(fā) web開發(fā) 服務(wù)器開發(fā)

  1. http參數(shù)怎么傳遞(GET)

http://open.qyer.com/lastminute/get_lastminute_list?client_id=qyer_ios&client_secret=cd254439208ab658ddf9&v=1&track_user_id=&track_deviceid=E57D6014-1D9F-437C-B9E5-17CF697370FA&track_app_version=5.4.4&track_app_channel=App%20Store&track_device_info=iPhone7,1&track_os=ios%208.1&lat=40.033568&lon=116.358971&app_installtime=1421832230&page_size=20&is_show_pay=1&country_id=0&continent_id=0&max_id=0&times=&product_type=0

1. http -> http協(xié)議  
2. open.qyer.com ->公司的服務(wù)器域名  
3. lastminute/get_lastminute_list -> 服務(wù)器程序唯一對應(yīng)一個方法  
4. ?是來分隔前面的請求方法和后面的參數(shù)的  
5. ?后面的內(nèi)容都是GET請求的參數(shù)信息  
6. client_id=qyer_ios:鍵值對的方式, client_id是參數(shù)名, 類似于函數(shù)的形參, qyer_ios是參數(shù)值,類似于函數(shù)的實參      

同步: 所有事情都是按照先后順序來做(效率比較低, 阻塞主線程)
異步: 所有事情都是同時進行(效率比較高)


目錄

一. NSURLConnection實現(xiàn)網(wǎng)絡(luò)下載

二. 根據(jù)城覓首頁的接口, 實現(xiàn)下載, 顯示數(shù)據(jù)

  1. 創(chuàng)建導(dǎo)航視圖控制器, 創(chuàng)建表格視圖TabelView
  2. 網(wǎng)絡(luò)下載數(shù)據(jù), 遵守協(xié)議NSURLConnectionDelegate, NSURLConnectionDataDelegate
  3. 用下載并解析好的數(shù)據(jù)創(chuàng)建數(shù)據(jù)源(使用KVC設(shè)置屬性值, 所以模型中要重寫- (void)setValue:(id)value forUndefinedKey:(NSString *)key)
  4. 自定義Cell(如果使用Xib的方式的話, 一定要在在.xib文件中設(shè)置重用標(biāo)簽), 注冊Cell, 實現(xiàn)UITableView的相關(guān)協(xié)議方法返回Cell等
  5. 因為網(wǎng)絡(luò)數(shù)據(jù)是異步下載的, 因此在成功下載數(shù)據(jù)創(chuàng)建數(shù)據(jù)源后需要刷新表格

三. 愛限免的首頁

  1. 新建UITabBarController的子類和5個視圖控制器的類
  2. 在新建的UITabBarController的子類中創(chuàng)建需要其管理的5個視圖控制器
  3. 設(shè)置LimitFreeController的導(dǎo)航條
  4. 下載數(shù)據(jù)創(chuàng)建表格視圖UITableView對象, 實現(xiàn)下載數(shù)據(jù)的代理方法(表格視圖的代理方法略)
  5. 創(chuàng)建模型類, 完成自定義Cell
  6. 處理下載數(shù)據(jù)創(chuàng)建數(shù)據(jù)源
  7. 實現(xiàn)UITableView的相關(guān)代理方法, 返回行數(shù), 設(shè)置cell高度, 返回cell

一. NSURLConnection實現(xiàn)網(wǎng)絡(luò)下載

二. 根據(jù)城覓首頁的接口, 實現(xiàn)下載, 顯示數(shù)據(jù)

NSURLConnection是系統(tǒng)實現(xiàn)網(wǎng)絡(luò)請求的方式

目標(biāo): 實現(xiàn)下圖效果

實現(xiàn)如圖效果
  1. 創(chuàng)建導(dǎo)航視圖控制器, 創(chuàng)建表格視圖TabelView
  2. 網(wǎng)絡(luò)下載數(shù)據(jù), 遵守協(xié)議NSURLConnectionDelegate, NSURLConnectionDataDelegate

NSURLConnectionDelegate 下載是否成功等信息
NSURLConnectionDataDelegate 處理返回的數(shù)據(jù)

1. 定義屬性: 網(wǎng)絡(luò)請求  

@property (nonatomic, strong) NSURLConnection *conn;
2. 下載數(shù)據(jù)
- (void)downloadData
{
// 1.創(chuàng)建NSURL對象
NSURL *url = [NSURL URLWithString:kHomeUrl];
// 2.創(chuàng)建NSURLRequest類型的對象
NSURLRequest request = [NSURLRequest requestWithURL:url];
// 3.創(chuàng)建NSURLConnection類型的對象, 會自動發(fā)送網(wǎng)絡(luò)請求
/

第一個參數(shù): 請求對象
第二個參數(shù): 代理
*/
_conn = [NSURLConnection connectionWithRequest:request delegate:self];
}
3. 接收下載數(shù)據(jù)并解析下載數(shù)據(jù)
* 定義屬性來接收下載的數(shù)據(jù)
@property (nonatomic, strong) NSMutableData *receiveData;
* 判斷是否下載成功, 如果服務(wù)器響應(yīng), 對下載數(shù)據(jù)進行接收解析

        1. 如果下載失敗執(zhí)行此方法

                - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
                {
                    NSLog(@"%@", error);
                }
            
        2.  網(wǎng)絡(luò)成功被服務(wù)器處理  

                // 返回響應(yīng)信息
                - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
                {
                    // 返回的響應(yīng)體
                    NSHTTPURLResponse *res = (NSHTTPURLResponse *)response;
                    
                    NSDictionary *dict = res.allHeaderFields;
                    NSLog(@"%@", dict);
                    
                    // 響應(yīng)的狀態(tài)碼
                    // 200: 正常返回
                    // 404: 客戶端程序錯誤
                    // 400: 客戶端的其它錯誤
                    // 500: 服務(wù)器的錯誤
                    NSInteger code = res.statusCode;
                    NSLog(@"%ld", code);
                    
                    // 清空下載回來的數(shù)據(jù)
                    [self.receiveData setLength:0];
                }
            
        3. 接收下載數(shù)據(jù)  

                // 通常下載的數(shù)據(jù)量會比較大, 會將數(shù)據(jù)分批下載
                // 每一次下載回來都會調(diào)用這個方法
                - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
                {
                    // 存儲下載回來的數(shù)據(jù)
                    // 每次下載的數(shù)據(jù)都在data這個形參中
                    [_receiveData appendData:data];
                }
            
        4. 下載結(jié)束時調(diào)用的代理方法  

                // 前面的代理方法都是異步調(diào)用的, 這個代理方法會將程序返回主線程
                - (void)connectionDidFinishLoading:(NSURLConnection *)connection
                {
                    // 下載結(jié)束, 處理數(shù)據(jù)
                    
                    // JSON解析
                    id result = [NSJSONSerialization JSONObjectWithData:self.receiveData options:NSJSONReadingMutableContainers error:nil];
                    
                    if ([result isKindOfClass:[NSDictionary class]]) {
                        NSDictionary *dict = result;
                        NSLog(@"%@", dict);
                    }
                }  
  1. 用下載并解析好的數(shù)據(jù)創(chuàng)建數(shù)據(jù)源(使用KVC設(shè)置屬性值, 所以模型中要重寫- (void)setValue:(id)value forUndefinedKey:(NSString *)key)
     // 下載結(jié)束時調(diào)用的代理方法
     // 前面的代理方法都是異步調(diào)用的, 這個代理方法會將程序返回主線程
     - (void)connectionDidFinishLoading:(NSURLConnection *)connection
     {
         // 下載結(jié)束, 處理數(shù)據(jù)
         
         // JSON解析
         id result = [NSJSONSerialization JSONObjectWithData:self.receiveData options:NSJSONReadingMutableContainers error:nil];
         
         if ([result isKindOfClass:[NSDictionary class]]) {
             NSDictionary *dict = result;
             NSArray *sectionArray = dict[@"sectioninfo"];
             
             for (NSDictionary *sectionDict in sectionArray) {
                 DataModel *model = [[DataModel alloc] init];
                 // KVC設(shè)置屬性值
                 [model setValuesForKeysWithDictionary:sectionDict];
                 [self.dataArray addObject:model];
             }
         }
     }
    
  2. 自定義Cell(如果使用Xib的方式的話, 一定要在在.xib文件中設(shè)置重用標(biāo)簽), 注冊Cell, 實現(xiàn)UITableView的相關(guān)協(xié)議方法返回Cell等
重用標(biāo)簽
  1. 因為網(wǎng)絡(luò)數(shù)據(jù)是異步下載的, 因此在成功下載數(shù)據(jù)創(chuàng)建數(shù)據(jù)源后需要刷新表格
     // 下載結(jié)束時調(diào)用的代理方法
     // 前面的代理方法都是異步調(diào)用的, 這個代理方法會將程序返回主線程
     - (void)connectionDidFinishLoading:(NSURLConnection *)connection
     {
         // 下載結(jié)束, 處理數(shù)據(jù)
         ……………………………………………………………………………………
         [self.tbView reloadData];
     }
    

三. 愛限免的首頁

最終效果圖
  1. 新建UITabBarController的子類和5個視圖控制器的類
如圖
  1. 在新建的UITabBarController的子類中創(chuàng)建需要其管理的5個視圖控制器
     - (void)createViewControllers
     {
         // 視圖控制器
         NSArray *ctrlArray = @[@"LimitFreeController", @"ReduceController", @"FreeController", @"SubjectController", @"HotController"];
         // 文字
         NSArray *titleArray = @[@"限免", @"降價", @"免費", @"專題", @"熱榜"];
         // 圖片
         NSArray *imageArray = @[@"tabbar_limitfree", @"tabbar_reduceprice", @"tabbar_appfree", @"tabbar_subject", @"tabbar_rank"];
         // 選中時的圖片
         NSArray *selectImageArray = @[@"tabbar_limitfree_press", @"tabbar_reduceprice_press", @"tabbar_appfree_press", @"tabbar_subject_press", @"tabbar_rank_press"];
     
         NSMutableArray *array = [NSMutableArray array];
         for (int i = 0; i < ctrlArray.count; i++) {
             // 類名
             NSString *name = ctrlArray[i];
             Class cls = NSClassFromString(name);
             UIViewController *ctrl = [[cls alloc] init];
             
             // 文字
             ctrl.tabBarItem.title = titleArray[i];
             // 圖片
             ctrl.tabBarItem.image = [UIImage imageNamed:imageArray[i]];
             // 選中時的圖片
             ctrl.tabBarItem.selectedImage = [UIImage imageNamed:selectImageArray[i]];
             
             // 添加導(dǎo)航
             UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:ctrl];
             // 添加到數(shù)組中
             [array addObject:navCtrl];
         }
         self.viewControllers = array;
     }
    
    • 快速新建不同類名的對象

      NSArray **ctrlArray = @[@"LimitFreeController", @"ReduceController", @"FreeController", @"SubjectController", @"HotController"];
      for (int i = 0; i < ctrlArray.count; i++) {
      // 類名
      NSString *name = ctrlArray[i];
      Class cls = NSClassFromString(name);
      UIViewController *ctrl = [[cls alloc] init];
      }

  2. 設(shè)置LimitFreeController的導(dǎo)航條
     - (void)configNavBar
     {
         // 設(shè)置導(dǎo)航欄背景圖片
         // 圖片拉伸 上下不拉伸 左邊5個點不拉伸
         [self.navigationController.navigationBar setBackgroundImage:[[UIImage imageNamed:@"navigationbar"] stretchableImageWithLeftCapWidth:5 topCapHeight:0] forBarMetrics:UIBarMetricsDefault];
         
         // 導(dǎo)航欄中間文字
         self.title = @"限免";
         // 導(dǎo)航條標(biāo)題文字顏色
         // 6個十六進制位表示顏色
         // #000000 ~ #FFFFFF
         [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithRed:30.0f/255.0f green:60.0f/255.0f blue:113.0f/255.0f alpha:1.0f], NSFontAttributeName:[UIFont systemFontOfSize:24]}];
         
         // 左右按鈕
         UIButton *leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
         leftBtn.frame = CGRectMake(0, 0, 60, 36);
         [leftBtn setBackgroundImage:[UIImage imageNamed:@"buttonbar_action"] forState:UIControlStateNormal];
         [leftBtn setTitle:@"分類" forState:UIControlStateNormal];
         [leftBtn setTitleColor:[UIColor cyanColor] forState:UIControlStateNormal];
         [leftBtn addTarget:self action:@selector(gotoCategory:) forControlEvents:UIControlEventTouchUpInside];
         self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftBtn];
         
         UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
         /*
         ………………………………………………………………………………………………………………………………………………………………………………
          */
     }
    
    • 圖片拉伸 上下不拉伸 左邊5個點不拉伸

    UIImage *image = [imageTemp stretchableImageWithLeftCapWidth:5 topCapHeight:0];

    • 設(shè)置導(dǎo)航條中間標(biāo)題文字顏色和字體

    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithRed:30.0f/255.0f green:60.0f/255.0f blue:113.0f/255.0f alpha:1.0f], NSFontAttributeName:[UIFont systemFontOfSize:24]}];`
    * 正確顯示TabBar上的小圖標(biāo)

     > // 圖片  
     ctrl.tabBarItem.image = [[UIImage imageNamed:imageArray[i]] **imageWithRenderingMode:**UIImageRenderingModeAlwaysOriginal];  
     // 選中時的圖片  
     ctrl.tabBarItem.selectedImage = [[UIImage imageNamed:selectImageArray[i]] **imageWithRenderingMode:**UIImageRenderingModeAlwaysOriginal];
    
  3. 下載數(shù)據(jù)創(chuàng)建表格視圖UITableView對象, 實現(xiàn)下載數(shù)據(jù)的代理方法(表格視圖的代理方法略)
    1. 新建屬性

       @property (nonatomic, strong) UITableView *tbView;
       @property (nonatomic, strong) NSMutableArray *dataArray;
       // 下載的數(shù)據(jù)
       @property (nonatomic, strong) NSMutableData *receiveData;  
      
    2. 下載數(shù)據(jù)
      - (void)downloadData
      {
      NSURLConnection *conn = [NSURLConnection connectionWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:kUrl]] delegate:self];
      // 遵守協(xié)議, 實現(xiàn)方法
      }

    3. 創(chuàng)建表格視圖, 代理方法略
      - (void)createTableView
      {
      // 導(dǎo)航下面
      self.automaticallyAdjustsScrollViewInsets = NO;

           _tbView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 375, 667-64-49) style:UITableViewStylePlain];
           _tbView.delegate = self;
           _tbView.dataSource = self;
           [self.view addSubview:_tbView];
       }
      
    4. NSURLConnection協(xié)議方法

       // 下載失敗 
       - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
       {
           NSLog(@"%@", error);
       }
       
       // 網(wǎng)絡(luò)請求返回
       - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
       {
           // 清空以前的數(shù)據(jù)
           [self.receiveData setLength:0];
       }
       
       // 每次下載數(shù)據(jù)返回
       - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
       {
           [self.receiveData appendData:data];
       }
       
       // 下載結(jié)束調(diào)用
       - (void)connectionDidFinishLoading:(NSURLConnection *)connection
       {
           
       }
      
  4. 創(chuàng)建模型類, 完成自定義Cell
    • Cell中的- (void)showData:(LimitFreeModel *)model row:(NSInteger)row方法
      - (void)showData:(LimitFreeModel *)model row:(NSInteger)row
      {
      // 背景圖片
      if (row % 2 == 0) {
      self.bgImageView.image = [UIImage imageNamed:@"cate_list_bg1"];
      } else {
      self.bgImageView.image = [UIImage imageNamed:@"cate_list_bg2"];
      }

            // 左邊圖片
            [self.leftImageView sd_setImageWithURL:[NSURL URLWithString:model.iconUrl]];
            // 名稱
            self.nameLabel.text = model.name;
            // 時間
            self.timeLabel.text = model.releaseDate;
            
            // 星級
            CGRect frame = self.starImageView.frame;
            frame.size.width = (model.starCurrent.floatValue / 5) * frame.size.width;
            self.starImageView.frame = frame;
            // 推跹靠模式
            self.starImageView.contentMode = UIViewContentModeLeft;
            self.starImageView.clipsToBounds = YES;
            
            // 價格
            self.priceLabel.text = model.lastPrice;
            // 類型
            self.typeLabel.text = model.categoryName;
            // 分享
            self.shareLabel.text = [NSString stringWithFormat:@"分享:%@", model.shares];
            // 收藏
            self.favouritesLabel.text = [NSString stringWithFormat:@"收藏:%@",model.favorites];
            // 下載
            self.downloadLabel.text = [NSString stringWithFormat:@"下載:%@",model.downloads];
        }  
      
    • .xib中除了連線以外, 勿忘設(shè)置cell的重用標(biāo)簽

      cell的重用標(biāo)簽
  5. 處理下載數(shù)據(jù)創(chuàng)建數(shù)據(jù)源
    • 在NSURLConnectionDataDelegate協(xié)議的- (void)connectionDidFinishLoading:(NSURLConnection *)connection方法中用下載數(shù)據(jù)創(chuàng)建數(shù)據(jù)源
      - (void)connectionDidFinishLoading:(NSURLConnection *)connection
      {
      // 處理下載數(shù)據(jù)
      // JSON解析
      id result = [NSJSONSerialization JSONObjectWithData:self.receiveData options:NSJSONReadingMutableContainers error:nil];
      if ([result isKindOfClass:[NSDictionary class]]) {
      NSDictionary *dict = result;

                NSArray *appArray = dict[@"applications"];
                for (NSDictionary *appDict in appArray) {
                    // 創(chuàng)建模型對象
                    LimitFreeModel *model = [[LimitFreeModel alloc] init];
                    // kvc
                    [model setValuesForKeysWithDictionary:appDict];
                    // 添加到數(shù)組
                    [self.dataArray addObject:model];
                }
                // 刷新表格
                [self.tbView reloadData];
            }
        }
      
  6. 實現(xiàn)UITableView的相關(guān)代理方法, 返回行數(shù), 設(shè)置cell高度, 返回cell
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末稼虎,一起剝皮案震驚了整個濱河市玻粪,隨后出現(xiàn)的幾起案子啃勉,更是在濱河造成了極大的恐慌烘豹,老刑警劉巖魏保,帶你破解...
    沈念sama閱讀 216,372評論 6 498
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件商虐,死亡現(xiàn)場離奇詭異仲器,居然都是意外死亡,警方通過查閱死者的電腦和手機皿渗,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,368評論 3 392
  • 文/潘曉璐 我一進店門斩芭,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人乐疆,你說我怎么就攤上這事划乖。” “怎么了挤土?”我有些...
    開封第一講書人閱讀 162,415評論 0 353
  • 文/不壞的土叔 我叫張陵琴庵,是天一觀的道長。 經(jīng)常有香客問我仰美,道長迷殿,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,157評論 1 292
  • 正文 為了忘掉前任咖杂,我火速辦了婚禮庆寺,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘诉字。我一直安慰自己懦尝,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 67,171評論 6 388
  • 文/花漫 我一把揭開白布壤圃。 她就那樣靜靜地躺著陵霉,像睡著了一般。 火紅的嫁衣襯著肌膚如雪伍绳。 梳的紋絲不亂的頭發(fā)上踊挠,一...
    開封第一講書人閱讀 51,125評論 1 297
  • 那天,我揣著相機與錄音冲杀,去河邊找鬼效床。 笑死,一個胖子當(dāng)著我的面吹牛漠趁,可吹牛的內(nèi)容都是我干的扁凛。 我是一名探鬼主播,決...
    沈念sama閱讀 40,028評論 3 417
  • 文/蒼蘭香墨 我猛地睜開眼闯传,長吁一口氣:“原來是場噩夢啊……” “哼谨朝!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起甥绿,我...
    開封第一講書人閱讀 38,887評論 0 274
  • 序言:老撾萬榮一對情侶失蹤字币,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后共缕,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體洗出,經(jīng)...
    沈念sama閱讀 45,310評論 1 310
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,533評論 2 332
  • 正文 我和宋清朗相戀三年图谷,在試婚紗的時候發(fā)現(xiàn)自己被綠了翩活。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片阱洪。...
    茶點故事閱讀 39,690評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖菠镇,靈堂內(nèi)的尸體忽然破棺而出冗荸,到底是詐尸還是另有隱情,我是刑警寧澤利耍,帶...
    沈念sama閱讀 35,411評論 5 343
  • 正文 年R本政府宣布蚌本,位于F島的核電站,受9級特大地震影響隘梨,放射性物質(zhì)發(fā)生泄漏程癌。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,004評論 3 325
  • 文/蒙蒙 一轴猎、第九天 我趴在偏房一處隱蔽的房頂上張望嵌莉。 院中可真熱鬧,春花似錦税稼、人聲如沸烦秩。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,659評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽只祠。三九已至,卻和暖如春扰肌,著一層夾襖步出監(jiān)牢的瞬間抛寝,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,812評論 1 268
  • 我被黑心中介騙來泰國打工曙旭, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留盗舰,地道東北人。 一個月前我還...
    沈念sama閱讀 47,693評論 2 368
  • 正文 我出身青樓桂躏,卻偏偏與公主長得像钻趋,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子剂习,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,577評論 2 353

推薦閱讀更多精彩內(nèi)容

  • iOS開發(fā)系列--網(wǎng)絡(luò)開發(fā) 概覽 大部分應(yīng)用程序都或多或少會牽扯到網(wǎng)絡(luò)開發(fā)蛮位,例如說新浪微博、微信等鳞绕,這些應(yīng)用本身可...
    lichengjin閱讀 3,657評論 2 7
  • 1.自定義控件 a.繼承某個控件 b.重寫initWithFrame方法可以設(shè)置一些它的屬性 c.在layouts...
    圍繞的城閱讀 3,385評論 2 4
  • *7月8日上午 N:Block :跟一個函數(shù)塊差不多失仁,會對里面所有的內(nèi)容的引用計數(shù)+1,想要解決就用__block...
    炙冰閱讀 2,485評論 1 14
  • 為什么要談紀(jì)錄片们何, 因為紀(jì)錄片是非虛構(gòu)寫作的親戚萄焦。 在上個世紀(jì)六十年代, 美國有一個“新新聞主義”冤竹, NewJou...
    王佩閱讀 3,281評論 11 80
  • 誰比我清楚 窗外的彎月變成了怪叔叔 尖尖地下巴戳破了夜幕 半開的窗簾布 你是待翻頁的書 世界多安靜拂封,能聽見鼾呼 似...
    小小文閱讀 205評論 0 0