uipickerview

Use data from NSUserDefaults in UIPickerView - pickerView stays empty

拈花ヽ惹草 提交于 2019-12-25 04:14:23
问题 I tried to set up NSUserDefaults last night but an error keeps occurring: ViewController3: save data @IBAction func tappedAddButton(sender: AnyObject) { var userDefaults:NSUserDefaults = NSUserDefaults.standardUserDefaults() var exercisesList:NSMutableArray? = userDefaults.objectForKey("exercisesList") as? NSMutableArray var dataSet:NSMutableDictionary = NSMutableDictionary() dataSet.setObject(textField.text, forKey: "exercises") if ((exercisesList) != nil){ var newMutableList:NSMutableArray

UIPickerView UIImage and Segue

谁都会走 提交于 2019-12-25 02:50:51
问题 In my app, I use the camera with UIImagePickerCollection in my UserView. But once the user, select "use photo" I would like to have my photo in an other view which is "cameraView" because I have some treatment to do with. Here is my code : -(void)takeAPicture{ NSLog(@"CHEESE"); UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.mediaTypes = @[(NSString *)

Populate the Selected value in Picker view

我只是一个虾纸丫 提交于 2019-12-25 02:37:06
问题 Here is my Problem. I had a uitableview which had add and edit functionality. At first when I click on Add button it displays a picker view with three components. Component 1 contains list of projects (Select,proj1, proj2, proj3, proj4). I select proj3 and click on submit. Data is able to save in the data base. Now Here comes my problem. The saved data is able to display in the tableview list. When I click on the respective record, it navigates to the detailed edit page where I see proj4 is

Adding UIPickerView to a UITableViewCell

折月煮酒 提交于 2019-12-24 16:35:08
问题 I want to add a UIPickerView to a UITableViewCell. Right now I am just getting a black window. Can someone also explain me the concept of subclassing UI objects to a cell ie:when do we make our cell as the delegate and the datasource delegate? Thanks EDIT: Here is the code of what i am doing right now case 1: { cell = [tableView dequeueReusableCellWithIdentifier:@"groups"]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"groups"];

Finding time between dates in Swift [duplicate]

痴心易碎 提交于 2019-12-24 13:41:24
问题 This question already has answers here : Getting the difference between two NSDates in (months/days/hours/minutes/seconds) (18 answers) Closed 4 years ago . Hi Im trying to work out the time between two dates using UIpickers and I am lost. I cannot fathom where to go to on this to get the value to plug into the label. Im not sure if I should use components or before the comparison or just after to put it in the label. Thanks for any pointers. let calendar = NSCalendar.currentCalendar() let

Changing the size of my UIPickerView in Swift

北城余情 提交于 2019-12-24 13:19:01
问题 I have a UIPickerView that I would like to change the size of frame. It seems that no matter how small I want it there is set minimum size that I can't go smaller than. I have seen other posts about this but they are very old and the code is much different now. I know how to adjust the height and width of the rows in the picker view but not the frame itself. Even in the Frame Inspector no matter what I change on the height and width it will not go smaller than a certain size. 回答1: You can't

Stuck with UIActionSheetPicker , iOS

无人久伴 提交于 2019-12-24 10:57:27
问题 This is going to be a very targeted question , as its for people that have actually used the UIActionSheetPicker before. I used it in my iphone applications and everything worked great , but now that i tried to implement it on my ipad i experienced some problems. The main problem is that on ipad the picker appears as a "bubble" or "info window" if you prefer , which points at the spot where it was called , like a button a text field etc. Below is an example of it : You can see that the "info

UIPicker font size for a certain column and row

好久不见. 提交于 2019-12-24 00:59:47
问题 I'm looking to change the font size of a certain column and row in a UIPicker. Basically there's too much text that runs off the view and I'd like to size just that particular row in the 2nd column down so it fits? thanks for any help. 回答1: If you want to customize label font size, implement delegate method called : -(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view; to return a well configured UILabel (you

“Failed to get refreshed snapshot” error when UI testing with a UIPickerView

孤人 提交于 2019-12-23 04:48:30
问题 I have a time selector view that uses a UIPickerView with 6 sections, hours, minutes, seconds and fixed label wheels between them. When I try to run a UI test against this view in XCode 7, the simulator freezes and I eventually see the error: "Failed to get refreshed snapshot" My test currently just attempts to interact with the cancel button in the view: app.buttons["Cancel"].tap() I've also tried waiting for the cancel button to exist. Removing the picker view from the UIView stops the test

How to implement the didSelectRow method of the pickerView class?

和自甴很熟 提交于 2019-12-22 16:38:50
问题 I have never worked with a picker view before. I assume it would be similar to the func tableView(tableView: UITableView, didDeselectRowAtIndexPath indexPath: NSIndexPath) method of the table view class. However I can not figure out how I will get the text from the picker value and display that in a label. I would like this to be done inside the postListing method.Can someone help me out with this please? Thanks. import UIKit class BooksViewController: UIViewController , UIPickerViewDelegate,