Populate the table view sections with rows of table in sqlite database in an order

后端 未结 2 1353
栀梦
栀梦 2020-12-21 06:49

I have 2 view controller pages.Add Reminder page which contains save button as right bar button of navigation bar

I have earlier got issues regarding number of secti

相关标签:
2条回答
  • 2020-12-21 07:45

    for making cell with that required color just write the following code in

    cell.contentView.backgroundColor=[UIColor colorWithPatternImage:@"Give your cell image"]
    

    in (UITableViewCell *)tableView:(UITableView *)view cellForRowAtIndexPath:(NSIndexPath *)indexPath method and not in condition, outside the condition you should put it. and why you do database work in this method. it will slow your apps. let me know for any clarification.

    0 讨论(0)
  • 2020-12-21 07:49

    I'm giving you one suggestion just try it. I hope it will work.

    Do one thing, just retrieve data from sqlite in viewDidAppear or viewWillAppear and save the data in an nsmutableArray.

    Then in - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section just return [yourArray count].

    and for reloading table just try with [self.tableview reloadData]

    I hope it'll be work. just let me know for any further clarification.

    0 讨论(0)
提交回复
热议问题