uitableview

Changing the height of a dynamic-height UITableViewCell after it's already appeared

微笑、不失礼 提交于 2020-01-06 20:14:38
问题 I followed this tutorial to create a dynamic height UITableViewCell. My prototype cell has 1 label (pretty simple). That label has constraints set to "0" for all sides of the cell edges. That label has numberOfLines = 0 and wraps the word. In my UITableView setup, I do this: self.tableView.rowHeight = UITableViewAutomaticDimension self.tableView.estimatedRowHeight = 100.0 //some random number Basically, everything works. Each cell has its own different height. The problem arises when I update

Pass data from plist based UITableView to UIViewController [duplicate]

十年热恋 提交于 2020-01-06 20:08:43
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to pass data to detail view after being selected in a table view? I have a TableViewController with a protoptype cell. It's populated with Labels and ImageViews from a .plist with an Array of Dictionaries. How can I pass this data to the detail View? The detail view is a UIViewController subclass. I've tried with methods from different tutorials but I just can't find the right combination to make it work.

Pass data from plist based UITableView to UIViewController [duplicate]

眉间皱痕 提交于 2020-01-06 20:07:55
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to pass data to detail view after being selected in a table view? I have a TableViewController with a protoptype cell. It's populated with Labels and ImageViews from a .plist with an Array of Dictionaries. How can I pass this data to the detail View? The detail view is a UIViewController subclass. I've tried with methods from different tutorials but I just can't find the right combination to make it work.

How to make one page pass on a message to another?

寵の児 提交于 2020-01-06 20:07:46
问题 My problem is different users will have access to different products. Say User 1 has access to 3 whereas User 2 has access to all 4. Can I have something upon Login where if User 1 logs in, it will tell the MainView to only show 3 cells? Something like ViewDidLoad in the MainView to read what the Login Page echo-ed? Can that be done? Thanks. 回答1: Store a global variable in appdelegate like numberOfCells . Assign value to it by the condition of your login. Once your MainView is about to

Know the row number inside custom UITableViewCell - new wrinkle

丶灬走出姿态 提交于 2020-01-06 19:49:11
问题 I have a custom UITableViewCell Class. The cell has editable UITextField. when this textfield is edited I trap the end of edit inside func textFieldDidEndEditing(_ textField: UITextField) my custom cell class implements UITextFieldDelegate so I do indeed get the call back. Similar to all the other responses to similar questions - I first tried to just set the tag on the UITextField to the row number when loading the table. This works - BUT - now there is a wrinkle .... My table allows the

Array displaying repeated object in table view cell

☆樱花仙子☆ 提交于 2020-01-06 19:46:06
问题 I am having a NSArray of size 11 as it formed below. labels = [NSMutableArray arrayWithObjects:@"DIN #",@"Brand Name",@"Full Name", @"Strength", @"Medication Type", @"Presciption ID", @"Next Dosage", @"Required Dosage", @"ada", @"dasdada", @"dasdasad", nil]; but when i am displaying this array in tableview cell Using this code. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {static NSString *CellIdentifier = @"Cell"; UITableViewCell

Data from JSON Parsing straight to UITableView

江枫思渺然 提交于 2020-01-06 19:36:48
问题 I am getting data using json with this code and I need to display it in a tableview with two part code and name the problem is writing it all to an array is taking forever and the array comes back null. How can I get each returned element as its own tableview cell? Hundreds of airports are returned. NSString* path = @"https://api.flightstats.com/flex/airports/rest/v1/json/active?appId=id&appKey=appkey"; NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString

iPhone : How to create expanadable table view?

左心房为你撑大大i 提交于 2020-01-06 19:34:41
问题 I want to create expandable table view. I found one link which is same as I want. But I want to create my own table view (Dont want to implements this github code). How do I achieve this type of functionality ? 回答1: See this nice tutorial: Table View Animations and Gestures Demonstrates how you can use animated updates to open and close sections of a table view for viewing, where each section represents a play, and each row contains a quotation from the play. It also uses gesture recognizers

iPhone : How to create expanadable table view?

会有一股神秘感。 提交于 2020-01-06 19:34:07
问题 I want to create expandable table view. I found one link which is same as I want. But I want to create my own table view (Dont want to implements this github code). How do I achieve this type of functionality ? 回答1: See this nice tutorial: Table View Animations and Gestures Demonstrates how you can use animated updates to open and close sections of a table view for viewing, where each section represents a play, and each row contains a quotation from the play. It also uses gesture recognizers

UITableView blinks if I do insertRowsAtIndexPaths

人走茶凉 提交于 2020-01-06 19:32:45
问题 I am adding rows to UITableView using the insertRowsAtIndexPaths method. I put this code between [myTable beginUpdates]; and [myTable endUpdates]; . The problem is that my table is blinking and then scrolls to the last row ? What might be the problem ? If I comment [myTable beginUpdates]; and [myTable endUpdates]; : then it works fine. Here is my code: #pragma mark - NSFetchResultController - (void)setFetchedResultsController:(NSFetchedResultsController*)fetchedResultsController {