国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

iOSUI基礎(chǔ)09

2019-11-14 18:33:29
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
  • 數(shù)據(jù)更新
    • 全局刷新
   #PRagma mark - 數(shù)據(jù)刷新操作- (IBAction)add {    // 添加模型數(shù)據(jù)    JXWine *wine = [[JXWine alloc] init];    wine.money = @"20.5";    wine.name = @"很好喝的酒";    wine.image = @"new_wine";    [self.wineArray insertObject:wine atIndex:0];    //    [self.wineArray addObject:wine];    // 告訴tableView:模型數(shù)據(jù)改變了,趕緊刷新表格    [self.tableView reloadData];}- (IBAction)remove {    // 刪除模型數(shù)據(jù)    [self.wineArray removeObjectAtIndex:0];    [self.wineArray removeObjectAtIndex:0];    // 告訴tableView:模型數(shù)據(jù)改變了,趕緊刷新表格    [self.tableView reloadData];}- (IBAction)update {//    JXWineCell *cell = (JXWineCell *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];//    cell.detailTextLabel.text = @"¥100";    // 更改模型數(shù)據(jù)    JXWine *wine = self.wineArray[0];    wine.money = @"100";    JXWine *wine2 = self.wineArray[1];    wine2.name = @"哈哈";    // 告訴tableView:模型數(shù)據(jù)改變了,趕緊刷新表格    [self.tableView reloadData];}
  • 局部刷新
   #pragma mark - 數(shù)據(jù)刷新操作- (IBAction)add {    // 添加模型數(shù)據(jù)    JXWine *wine = [[JXWine alloc] init];    wine.money = @"20.5";    wine.name = @"很好喝的酒";    wine.image = @"new_wine";    [self.wineArray insertObject:wine atIndex:0];    JXWine *wine2 = [[JXWine alloc] init];    wine2.money = @"100.5";    wine2.name = @"很好";    wine2.image = @"new_wine";    [self.wineArray insertObject:wine2 atIndex:0];    // 刷新    NSArray *indexPaths = @[                            [NSIndexPath indexPathForRow:0 inSection:0],                            [NSIndexPath indexPathForRow:1 inSection:0]                            ];    [self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationRight];}- (IBAction)remove {    // 刪除模型數(shù)據(jù)    [self.wineArray removeObjectAtIndex:0];    [self.wineArray removeObjectAtIndex:0];    // 刷新    NSArray *indexPaths = @[                            [NSIndexPath indexPathForRow:0 inSection:0],                            [NSIndexPath indexPathForRow:1 inSection:0]                            ];    [self.tableView deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationMiddle];}- (IBAction)update {    // 更改模型數(shù)據(jù)    XMGWine *wine = self.wineArray[0];    wine.money = @"100";    XMGWine *wine2 = self.wineArray[2];    wine2.image = @"new_wine";    XMGWine *wine3 = self.wineArray[3];    wine3.image = @"new_wine";    // 局部刷新    NSArray *indexPaths = @[                            [NSIndexPath indexPathForRow:0 inSection:0],                            [NSIndexPath indexPathForRow:2 inSection:0],                            [NSIndexPath indexPathForRow:3 inSection:0]                            ];    [self.tableView reloadRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationLeft];}

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 商城县| 崇信县| 若羌县| 兖州市| 衡阳县| 五大连池市| 新宾| 汉寿县| 延津县| 江陵县| 元谋县| 昆明市| 阿坝| 阿瓦提县| 尼勒克县| 嘉峪关市| 镇康县| 永善县| 莱芜市| 河北省| 马尔康县| 安阳市| 象州县| 望都县| 石台县| 普定县| 沁水县| 莱州市| 平武县| 文山县| 仙桃市| 文昌市| 于都县| 嘉定区| 昌吉市| 同江市| 宣汉县| 广南县| 二手房| 珲春市| 乐昌市|