uitableview

UITableView setEditing to NO doesn't change barButtonItem back

烂漫一生 提交于 2020-01-16 00:41:13
问题 I have a UITableViewController inside of a UINavigationController . I am setting the rightBarButtonItem to the editing button: self.navigationItem.rightBarButtonItem = self.editButtonItem; This works great, and after I call tableView:commitEditingStyle:forRowAtIndexPath: I programmatically change my tableView out of editing mode using: [self.tableView setEditing:NO animated:YES]; The strange thing here is, the barButtonItem still seems to be in "edit mode" as it still says "Done" like it does

Ordering core data objects inside a table view section

本秂侑毒 提交于 2020-01-16 00:39:11
问题 I am using NSSortDescriptors to order core data objects and create table view sections depending on a date attribute. Using this kind of SortDescriptor, the table view sections are ordered as expected, but the rows inside the sections are also ordered by the same date attribute. Is there a way to have another ordering system inside each section? I guess the main problem is that core data stores date objects with date+time values, that way there are no objects with exactly the same date value.

Change UITableviews height to fit its content in xcode?

前提是你 提交于 2020-01-15 23:38:54
问题 I need to make UITaableView to fit its content.I m loading array data in UITableView .But when I fixed some static size ,eventhough the items are less it is showing the extra space.So I need to make dynamic height to UITableView but could not achieve it .. autocompleteTableView = [[UITableView alloc] initWithFrame:CGRectMake(10, 140, 200, self.autocompleteTableView.contentSize.height) style:UITableViewStyleGrouped]; autocompleteTableView.delegate = self; autocompleteTableView.dataSource =

Change UITableviews height to fit its content in xcode?

血红的双手。 提交于 2020-01-15 23:38:31
问题 I need to make UITaableView to fit its content.I m loading array data in UITableView .But when I fixed some static size ,eventhough the items are less it is showing the extra space.So I need to make dynamic height to UITableView but could not achieve it .. autocompleteTableView = [[UITableView alloc] initWithFrame:CGRectMake(10, 140, 200, self.autocompleteTableView.contentSize.height) style:UITableViewStyleGrouped]; autocompleteTableView.delegate = self; autocompleteTableView.dataSource =

Change UITableviews height to fit its content in xcode?

▼魔方 西西 提交于 2020-01-15 23:38:11
问题 I need to make UITaableView to fit its content.I m loading array data in UITableView .But when I fixed some static size ,eventhough the items are less it is showing the extra space.So I need to make dynamic height to UITableView but could not achieve it .. autocompleteTableView = [[UITableView alloc] initWithFrame:CGRectMake(10, 140, 200, self.autocompleteTableView.contentSize.height) style:UITableViewStyleGrouped]; autocompleteTableView.delegate = self; autocompleteTableView.dataSource =

Swift在HomeKit中管理用户住宅(HMHome)(二)

◇◆丶佛笑我妖孽 提交于 2020-01-15 22:24:49
第一步:打开HomeKit的功能 第二步:plist文件设置权限,String类型,随便写点什么 Privacy - HomeKit Usage Description 第三步:获取房间列表,这里用的是个tableView接收的,应该大家都能看的懂,tableView的第一次reload必须在HomeKit初始化完成的时候,也就是代理方式homeManagerDidUpdateHomes之中 class ViewController: UIViewController,UITableViewDataSource,UITableViewDelegate ,HMHomeManagerDelegate{ @IBOutlet weak var tableView: UITableView? lazy var manager: HMHomeManager = { let manager = HMHomeManager() manager.delegate = self return manager }() override func viewDidLoad() { super.viewDidLoad() self.tableView?.register(UITableViewCell.self, forCellReuseIdentifier: "cell") } func tableView

Swift在HomeKit向用户的住宅添加房间(HMRoom)(三)

笑着哭i 提交于 2020-01-15 22:23:26
查询HMHome的房间列表 import UIKit import HomeKit class RoomsVC: UIViewController,UITableViewDataSource,UITableViewDelegate ,HMHomeDelegate{ @IBOutlet weak var tableView: UITableView? var home:HMHome!{ didSet{ home.delegate = self; } } override func viewDidLoad() { super.viewDidLoad() self.title = "rooms" self.navigationItem.rightBarButtonItem = UIBarButtonItem.init(barButtonSystemItem: .add, target: self, action: #selector(addRooms)) self.tableView?.register(UITableViewCell.self, forCellReuseIdentifier: "cell") } @objc func addRooms(){ let addRoomVC = AddRoomsVC.init(nibName: "AddRoomsVC", bundle:

Checkbox in UITableView Cell

我怕爱的太早我们不能终老 提交于 2020-01-15 19:14:38
问题 I've written an app which list the title, a thumbnail and the second-hand price of some books. It's all done using a UITableView and the data is taken from a .plist file. What I want to add is a checkbox to each cell which can be toggled if the user has the book or not and then store that checkbox state for the next time they use the app. Is it possible to store a value back to the .plist file or is there another way to do it? Here's the code I have so far for the cell: @implementation

UITableView grouped and .plist

左心房为你撑大大i 提交于 2020-01-15 19:14:08
问题 I wanted to make a sectioned UITableView using plist. Originally, my plist was structured this way: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>name</key> <string>First</string> <key>description</key> <string>First</string> <key>image</key> <string>image.png</string> </dict> <dict> <key>name</key> <string>Second</string> <key>description</key> <string

Checkbox in UITableView Cell

梦想与她 提交于 2020-01-15 19:12:30
问题 I've written an app which list the title, a thumbnail and the second-hand price of some books. It's all done using a UITableView and the data is taken from a .plist file. What I want to add is a checkbox to each cell which can be toggled if the user has the book or not and then store that checkbox state for the next time they use the app. Is it possible to store a value back to the .plist file or is there another way to do it? Here's the code I have so far for the cell: @implementation