uitableview

How do I make multiple tableview cells to lead corresponding view controllers?

落爺英雄遲暮 提交于 2020-01-07 08:03:50
问题 I am making an app with a tableViewController as the initial view controller. It obviously has a list of items in tableview cells. I want each of the tableView cell to lead to a different View controller. Here is an example of my home screen: ![enter image description here][1] What I am trying to achieve, for example, is that the tools cell will take me to a View controller with details about tools. And when I click on weapons, it should take me to a view controller with details about weapons

How to resize images in UITableViewCell?

自作多情 提交于 2020-01-07 07:41:18
问题 I am trying to make an Xcode app that has a list that loads data from a JSON file. It basically has a title, subtitle, and a thumbnail image. When the app loads up, the images are exactly as big as the cells. I would either like to resize the images to a set size, or make some extra room in-between the cells. Here is my current code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"TableCell";

Swift: Filter a POST http request answer

感情迁移 提交于 2020-01-07 07:38:10
问题 On swift, I am querying a server by an HTTP Post request, with: let myUrl = NSURL(string: "http://****.*****.***.***/****.php"); let request = NSMutableURLRequest(URL:myUrl!); request.HTTPMethod = "POST" let session = NSURLSession.sharedSession() var getDefaults = NSUserDefaults.standardUserDefaults(); var password = getDefaults.valueForKey("password") as! String; var id = getDefaults.valueForKey("login") as! String; var err: NSError? let postString = "Method=Tasks.getTasksByFolder" + "

Selected button in cell is showing up on reuse cells - also using sender.tag for button distinction

拟墨画扇 提交于 2020-01-07 06:57:11
问题 I have a bunch of rows in a table and each row consists of 6 UIButtons (they are checkbox images). I started with just trying to get one button to work before linking all of them and that worked somewhat. The code would update the image to a checked box if I clicked on it and if I scrolled down and back up the first cell first box would be the only one checked. If I repeatedly scroll up and down though, it will randomly unselect that first cell first box. Here is my ViewController code: // //

Hide buttons in cell by other button press uitableview

南笙酒味 提交于 2020-01-07 06:54:18
问题 Wondering how can I get all items of each cell in UITableView . My problem is that I want to hide 2 buttons in cell when third is selected. When I press on button 1, button 2 and 3 must be hidden. What I tried to do for that (in cellForRowAtIndexPath) : AVMMovieButton *settings = (AVMMovieButton *)[cell viewWithTag:228]; [settings addTarget:self action:@selector(selectSettings:) forControlEvents:UIControlEventTouchUpInside]; settings.tag = indexPath.row; AVMMovieButton *playButton =

How to get Int from DateFormatter() in Swift3

我只是一个虾纸丫 提交于 2020-01-07 06:47:18
问题 I want to remove some data from my UITableView when the data is passed over 24 hours. I saved date as String. I want to check the date but because it is String , how am I able to turn that data into Int value in order to check how many hours have passed since the data is last entered? Is there any good code for that to happen? This date data is stored in Firebase. let currentDateTime = Date() let formatter = DateFormatter() formatter.timeStyle = .medium formatter.dateStyle = .long let date =

Loading links from an XML file onto a UIWebView (SIGABRT error)

爷,独闯天下 提交于 2020-01-07 06:34:08
问题 I have been trying to parse an XML file in order to get articles from a website using background fetch. Someone gave me an answer to this question here. However, his answer resulted in an SIGABRT error. Could someone please look at my code and see what my problem is? Thanks in advance. My CODE: NewsViewController.h (This file loads a uitableview that runs the background fetch to get the articles): #import <UIKit/UIKit.h> @interface NewsViewController : UIViewController<UITableViewDelegate,

How to resize custom UITableViewCell nib file to fit tableView?

£可爱£侵袭症+ 提交于 2020-01-07 05:47:29
问题 My app currently loads like this. As you can see this is not ideal b/c the cell does not fill the entire cell. Also if you notice on the very left of every cell, the white separator line stops before the end of the cell. I'm using a nib file DayofWeekSpendingTableViewCell.xib to customize my tableview cell. Dimensions of UILabel dayOfWeek in nib file Dimensions of UILabel totalAmountSpent in nib file I have a UITableViewController SummaryTableViewController where I load the nib file. In the

iOS Populating UITableView with Data from Plist

百般思念 提交于 2020-01-07 05:41:07
问题 I am trying to populate a UTTableView with the contents of my Data.plist file. I need to load this into an NSMutableArray . This is how far I came: (View Did Load): NSString *PlistPath = [[NSBundle mainBundle] pathForResource:@"Data" ofType:@"plist"]; Array = [[NSMutableArray alloc] initWithContentsOfFile:PlistPath]; [Array addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Testing 1", @"name", nil]]; And of course at CellForRowAtIndexPath : cell.textLabel.text = [Array

Multi Row-Column tableView in iOS SDK [closed]

﹥>﹥吖頭↗ 提交于 2020-01-07 04:49:08
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . In my app, How can I show the data in tableView as per following image. Help me to solve this problem? Thank You. 回答1: You can use collectionView for this purpose.As it is looking like a grid View , so