uitableview

IOS: choice a UIScrollView or a UITableView

自古美人都是妖i 提交于 2020-01-22 13:36:07
问题 In my app I should create a view with a loto of informations; these informations are divided in 4 section, every section can contain text, images lists ecc... this is a brutal example... Now I'm dubious to what type of solution to adopt. In a my fast opinion a big scrollview is difficult to organize. And a big tableview with section is complicated to organize with code... What are your ideas? 回答1: You should go with UITABLEVIEW , easy to manage easy to understand, more reusability and good

Select uitableview row programmatically

我们两清 提交于 2020-01-22 10:55:25
问题 i have read a lot on this argument, i have tested this example that works: source code example. but this doesn't use storyboards (i don't know if this is the reason that make my project not working) i have made another project using storyboard, the same sequence of instruction doesn't work... -(void)viewDidAppear:(BOOL)animated{ NSIndexPath *indexPath = [NSIndexPath indexPathForRow:1 inSection:0]; [firstController.tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition

Using long press gesture to reorder cells in tableview?

一曲冷凌霜 提交于 2020-01-22 10:44:05
问题 I want to be able to reorder tableview cells using a longPress gesture (not with the standard reorder controls). After the longPress is recognized I want the tableView to essentially enter 'edit mode' and then reorder as if I was using the reorder controls supplied by Apple. Is there a way to do this without needing to rely on 3rd party solutions? Thanks in advance. EDIT: I ended up using the solution that was in the accepted answer and relied on a 3rd party solution. 回答1: So essentially you

How to make a table from a dictionary with multiple content types in Swift?

青春壹個敷衍的年華 提交于 2020-01-22 10:33:51
问题 I have made an NSArray with NSDictionary objects containing contents downloaded from an api. I also made a tableview object on main.storyboard with a prototype cell with a UIImage label and two text labels as its contents. How can I put the data from array to table so that each cell with same style as my prototype shows contents of NSDictionary from the array. 回答1: You have to implement UITableViewDataSource methods Remember to set dataSource property of tableView to ViewController Than you

Xcode 5.1 UITableView in UIViewController - Custom TableViewCell Outlets are nil

落花浮王杯 提交于 2020-01-22 10:04:28
问题 I have a UITableView as a subview in a UIViewController. I'm not using UITableViewController because I have some other content that is not tableview-related taking up part of the screen. I am using storyboards. I have the tableview set up as an outlet, with the viewcontroller being the datasource and delegate. If I use the standard UITableViewCell in this scenario, everything works well and I can load content. I need to use a custom UITableViewCell for this tableview, so I performed the

Matt Gallagher's UITableView (Revisited) + NSFetchedResultsController

一世执手 提交于 2020-01-22 04:45:46
问题 If you look at Matt Gallagher's Cocoa With Love blog, he has a brilliant discussion (with sample code) on a fresh a beautiful retake on UITableView ... In the post, he talks about it's great many benefits of animations and heterogeneous cells, etc. However, one of the limitations he lists is a bit of a show-stopper for me. It won't work with NSFetchedResultsController. The design of loading data into the cells assumes that all that data is static and available immediately. However, if you are

CellForRowAtIndexPath is not invoked

女生的网名这么多〃 提交于 2020-01-22 04:11:37
问题 I'm writing an app hat has many views and I used sliding views library ( ECSlidingViews ). The problem is when I fill an array with objects and fill the table with the objects in tableView:cellForRowIndexPath: method, it does present the data in the table, but when I go to other view and come back the data disappears because tableView:cellForRowIndexPath: is not called. Here is the code: -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

Reload tableview inside a UIview

家住魔仙堡 提交于 2020-01-22 03:58:05
问题 My table view is inside a UI View, this has been done writing codes, now i am trying to reload the data in table view but the table view is not refreshing. The UIview and the table view declaration are as follows: @interface { IBOutlet UITableView *tabView; } @property (nonatomic, strong) IBOutlet * tabView @property (nonatomic, strong) UIView * myView; // in .m file 回答1: Provided you have linked up the delegate and the data source methods of the table view correctly, you could just do :

Saving Bool/ tableView Checkmark - 3rd time lucky

一笑奈何 提交于 2020-01-22 02:30:37
问题 This is third time I've posted this issues and am yet to get a working response. So I have a fitness app, the user selected one workout before it been displayed as table view, when a cell is selected I want it to show that cell(containing an exercise) as completed by marking it with a checkmark. this works fine but I am struggling with how to save that check mark when the app is terminated and re launched. Below I have given an example of one of the workout models and the table view

UITableView won't scroll after editing view frame and origin

孤街醉人 提交于 2020-01-22 02:18:05
问题 I'm trying to implement a UITextView in a table cell at the bottom of a table view. I've tried the suggestions here Making a UITableView scroll when text field is selected, and other solutions as well, but they're a bit different because I have to artificially add extra height to the current view in order to create space for the keyboard. Here's what I added to the previous solution in order to port it to my app. -(void) keyboardWillShow:(NSNotification *)note { CGRect frame = self.view.frame