Search Results

Search found 32 results on 2 pages for 'uipicker'.

Page 1/2 | 1 2  | Next Page >

  • TTActionSheetController adding a UIPicker

    - by Ward
    I know how to add a uipicker to a uiactionsheet, how can one be added to the ttactionsheetcontroller? I see a reference to actionSheet within the controller, but setting the bounds to accommodate the uipicker doesn't seem to have any affect. And ideas? Best, Ward

    Read the article

  • table to updated after selection with uipicker

    - by Guille10k
    An UIPicker shows up when I select a row in a table, so I can choose some things I want to be displayed on the same row. How can I update the table once I finished with the uipicker? I used reloadData right after the call to the picker, but the code is executed before I do "Done" on the picker. Some idea? Thank u

    Read the article

  • Drawing the UIPicker values from multiple components?

    - by Rob
    I have the UIPicker setup with multiple components and a button below it. Depending on what the user has chosen with the UIPicker determines which new view will be loaded but I am having trouble determining how to extrapolate the information from the picker itself. Right now I have this method being called when the button is pressed: - (IBAction) buttonPressed { if (component:1 == 1 && component:2 == 1) { //Load the view number 1. } else if (component:1 == 2 && component:2 == 1) { //Load the view number 2. } else { //Load the view number 3. } } I obviously know that my code is wrong but I hope it gets the point across. I have multiple components and I need to figure out how to use the information that the user is scrolling to on the picker to determine which view to move to. (I know how to load the views, I just commented those in the code to illuminate the problem areas better.)

    Read the article

  • UIPicker EXC_BAD_ACCESS after repeated usage

    - by alexeyndru
    i populate uipicker's datasource from array built with sqlite database stored data. everythiongs works fine.. for a little while. after 6-7 spinnings, the picker freeze, and I get EXC_BAD_ACCESS. debugger indicates the program stopped in the main () function. so, how could this happen? working for a while, and then, suddenly exit like that? thanks

    Read the article

  • UIPicker reloading content

    - by kumaravel
    Hi i have a problem with UIPicker, im keeping my Picker in Navigation controller. i want the Picker content to reload whenever the navigation controller push the PickerView. but the pickerview content maintaining same state in all navigation.. how to change this?

    Read the article

  • Creating a common selector class with UITableView or UIPicker

    - by trevrosen
    I have several places in my app where I need to select a Foo for further processing from a list of Foo objects. I'd like to do this as a modal view, but neither UIPicker nor UITableView seems to lend itself to the standard approach, since the usual way to do a modal view controller involves setting the parent view controller up as the delegate, and both of those classes need to implement data source protocols, etc. Implementing the data source and selection protocol methods in my parent view controller defeats the purpose of trying to use one common class for implementing this modal selector screen all over my app. Does anyone have any solutions to this problem or am I effectively stuck implementing this selector class over and over again?

    Read the article

  • populate uipicker view with results from core data DB using an NSArray

    - by Chris
    I am trying to populate a UIPickerView with the results of a NSFetchRequest. The results of the NSFetchRequest are then stored in an NSArray. I am using Core Data to interact with the SQLite DB. I have a simple class file that contains a UIPickerView that is associated with a storyboard scene in my project. The header file for the class looks like the following, ViewControllerUsers.h #import <UIKit/UIKit.h> #import "AppDelegate.h" @interface ViewControllerUsers : UIViewController <NSFetchedResultsControllerDelegate, UIPickerViewDelegate, UIPickerViewDataSource> { NSArray *dictionaries; } @property (nonatomic, strong) NSFetchedResultsController *fetchedResultsController; // Core Data @property (strong, nonatomic) NSManagedObjectContext *managedObjectContext; @property (nonatomic, strong) NSArray *users; @property (strong, nonatomic) IBOutlet UIPickerView *uiPickerViewUsers; @property (weak, nonatomic) IBOutlet UIBarButtonItem *btnDone; @property (weak, nonatomic) IBOutlet UIButton *btnChangePin; // added for testing purposes @property (nonatomic, strong) NSArray *usernames; - (IBAction)dismissScene:(id)sender; - (IBAction)changePin:(id)sender; @end The implementation file looks like the following, ViewControllerUsers.m #import "ViewControllerUsers.h" @interface ViewControllerUsers () @end @implementation ViewControllerUsers // Core Data @synthesize managedObjectContext = _managedObjectContext; @synthesize uiPickerViewUsers = _uiPickerViewUsers; @synthesize usernames = _usernames; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. // Core Data if (_managedObjectContext == nil) { _managedObjectContext = [(AppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext]; NSLog(@"After _managedObjectContext: %@", _managedObjectContext); } NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Account"]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Account" inManagedObjectContext:_managedObjectContext]; request.resultType = NSDictionaryResultType; request.propertiesToFetch = [NSArray arrayWithObject:[[entity propertiesByName] objectForKey:@"username"]]; request.returnsDistinctResults = YES; _usernames = [_managedObjectContext executeFetchRequest:request error:nil]; NSLog (@"names: %@",_usernames); } -(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { //One column return 1; } -(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { //set number of rows return _usernames.count; } -(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { //set item per row return [_usernames objectAtIndex:row]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (void)viewDidUnload { [self setBtnDone:nil]; [self setUiPickerViewUsers:nil]; [self setBtnChangePin:nil]; [super viewDidUnload]; } - (IBAction)dismissScene:(id)sender { [self dismissModalViewControllerAnimated:YES]; } - (IBAction)changePin:(id)sender { } @end The current code is causing the app to crash, but the NSLog is show the results of the NSFetchRequest in the NSArray. I currently think that I am not formatting the results of the NSFetchRequest in the NSArray properly if I had to take a guess. The crash log looks like the following, 2013-06-26 16:49:24.219 KegCop[41233:c07] names: ( { username = blah; }, { username = chris; }, { username = root; } ) 2013-06-26 16:49:24.223 KegCop[41233:c07] -[NSKnownKeysDictionary1 isEqualToString:]: unrecognized selector sent to instance 0xe54d9a0 2013-06-26 16:49:24.223 KegCop[41233:c07] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSKnownKeysDictionary1 isEqualToString:]: unrecognized selector sent to instance 0xe54d9a0' First throw call stack:

    Read the article

  • iphone UIPicker question

    - by Rob
    I have a picker that prompts the user to choose a gender and an age group (17-21, 22-26, etc.) These 2 choices determine which view the user will be brought to after pressing the button, but I am having troubles writing the method for that button. The code I have so far is this: - (IBAction) buttonPressed { NSInteger genderRow = [genderPicker selectedRowInComponent:0]; NSString *genderSelected = [genderPickerData objectAtIndex:genderRow]; NSInteger ageRow = [agePicker selectedRowInComponent:1]; NSString *ageSelected = [agePickerData objectAtIndex:ageRow]; if (genderSelected == "Male" && ageSelected == "17-21") { Calc2ViewController *calc2ViewController = [[Calc2ViewController alloc] initWithNibName:@"Calc2View" bundle:[NSBundle mainBundle]]; [self.navigationController pushViewController:calc2ViewController animated:YES]; [calc2ViewController release]; calc2ViewController = nil; } } When I run the program, and select these 2 groups (Male and 17-21) - nothing happens. What am I missing?

    Read the article

  • Multiple Row Selection in UIPickerView

    - by medma
    hi frends, Today I have a problem related to uipicker. I want to select multiple rows in picker, so I have an idea to show my data in a table and add this table as subview to picker. I have tried a lot but didn't succeed. Please help if u can?? Thanx Ankit

    Read the article

  • UIPickerView not displaying

    - by 4thSpace
    I have a UIPickerView on a UIView. I've implemented its protocol and delegates in the .m file: <UIPickerViewDataSource, UIPickerViewDelegate> In IB, I've connected the above to the picker, which I also have an IBoutlet for. The methods look like this: - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView { return 1; } - (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component { return [self.arr count]; } - (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { return @"test"; } - (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { //do something } Any ideas which piece I'm missing to get the picker working?

    Read the article

  • UIPageViewController: How to refer the UIPicker selected Value from 1 Viewcontroller to another...

    - by Abhinav
    I am referring the code from here, please have look at the code while answering my question : http://www.ioslearner.com/wp-content/uploads/2011/12/UIPageViewControllerDemo.zip important notes and few changes: I basically have a viewcontroller and contentviewcontroller . ViewController - have following UIPAgeViewController Datasource and Deligate UIPickerView - upon next and previous page turn the value in the PickerView changes contentviewcontroller - has following UIWebview - defined in Viewdidload of contentviewcontroller which dynamically fetches a html page based upon the string value (LabelContents) sent through following method -(UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController is there a way to populate the UIWebview in contentviewcontroller based upon the row selected in UIPickerView ? Kindly help.

    Read the article

  • UIPickerview is not visible in additionally added view

    - by MaheshBabu
    Hi folks, i created an additional IBOutlet UIView. at the same time i place the IBOutlet UIPicker view in additional view. Give connections and add Addtional view as subview to main view. As [self.view addsubview:addtionalview]; I write this code in one button click event. Unfortunatly i got additional view in button click but it did n't show UIPicker. whats the wrong. I already have Two UIPicker view in main view. How can i add UIPicker view in added view. Thank u in advnace.

    Read the article

  • iphone not displaying array variables correctly

    - by Rob
    I was reading a tutorial on how to do a UIPicker and found this code: - (IBAction)buttonPressed { NSInteger row = [userPicker selectedRowInComponent:0]; NSString *selected = [userPickerData objectAtIndex:row]; NSString *title = [[NSString alloc] initWithFormat:@"You selected %a", selected]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:@"Thank you for Choosing." delegate:nil cancelButtonTitle:@"You're Welcome" otherButtonTitles:nil]; [alert show]; [alert release]; [title release]; } - (void)viewDidLoad { // [super viewDidLoad]; NSArray *array = [[NSArray alloc] initWithObjects:@"New", @"Frank", @"Bob", @"Thor", nil]; self.userPickerData = array; [array release]; } The UIPicker displays correctly and the variables in the picker also display correctly. When the button is pressed then the alert message does come up but it says, "You selected.." and then it's a bunch of gibberish. Why aren't the array variables being passed correctly?

    Read the article

  • iPhone producing strange results on 'if' statement

    - by Rob
    I have a UIPicker where the user inputs a specified time (i.e. 13:00, 13:01, 13:02, etc.) - which determines their score. Once they hit the button an alert comes up with the score that is determined through this 'if-else' statement. Everything seems to work great MOST of the time - but I am getting some erratic behavior. This is the code: //Gets my value from the UIPicker and then converts it into a format that can be used in the 'if' statement. NSInteger runRow = [runTimePicker selectedRowInComponent:2]; NSString *runSelected = [runTimePickerData objectAtIndex:runRow]; NSString *runSelectedFixed = [runSelected stringByReplacingOccurrencesOfString:@":" withString:@"."]; //The actual 'if' statment. if ([runSelectedFixed floatValue] <= 13.00) { runScore = 100; } else if ([runSelectedFixed floatValue] <= 13.06) { runScore = 99; } else if ([runSelectedFixed floatValue] <= 13.12) { runScore = 97; } else if ([runSelectedFixed floatValue] <= 13.18) { runScore = 96; } else if ([runSelectedFixed floatValue] <= 13.24) { runScore = 94; } else if ([runSelectedFixed floatValue] <= 13.30) { runScore = 93; } else if ([runSelectedFixed floatValue] <= 13.36) { runScore = 92; } else if ([runSelectedFixed floatValue] <= 13.42) { runScore = 90; } else if ([runSelectedFixed floatValue] <= 13.48) { runScore = 89; } else if ([runSelectedFixed floatValue] <= 13.54) { runScore = 88; } Now, when I test the program, I will get the expected result when I choose '13:00' which is '100'. I also get the expected result of '99' when I choose all of the times between '13:01 and 13:05'. BUT, when I choose '13:06' it gives me a score of '97'. I also get a score of '97' on '13:07 through 13:12' - which is the desired result. Why would I get a '97' right on '13:12' but not get a '99' right on '13:06'???? Could this be a memory leak or something???

    Read the article

  • Allowing user to select a UIPickerView row by tapping.

    - by camilo
    Hi. I'm trying to use a UIPicker View with a behavior somehow different of what's usually seen in iPhone code examples. What I want to do is to allow users to scroll through the picker contents, but not to select a picker's row automatically (using the "didSelectRow" method from picker's delegate). Instead, I want to allow the user to touch the center row of the picker, which gets highlighted, and becomes the selection. Is there any way to achieve this? Thanks in advance.

    Read the article

  • UIPickerView issues - iphone

    - by Rob J
    I have the following: - (NSInteger) numberOfComponentsInPickerView:(UIPickerView *)pickerView { return 2; } - (NSInteger) pickerView:(UIPickerView *) pickerView numberOfRowsInComponent:(NSInteger) component { return [genderPickerData count]; return [agePickerData count]; } When I do this, the UIPicker is split into 2 components, but the PickerData is only being represented for gender on both pickers. I am trying to figure out through Apple's confusing documentation on how I reference each individual component but can't seem to figure it out.

    Read the article

  • Multiple row selection in uipickerView

    - by medma
    Hi frends, I have implemented multiple row selection by making uipicker with components and rows = 0, and add uitableview as subview to picker. But now i have a problem that some of the values in the table are checked automatically which creates problem in my application. plz tell me what to do to rectify this. Thanx.

    Read the article

  • iPad and UIPickerView (or UIDatePickerView)

    - by Staros
    Hey all, Has anyone had any luck using a UIPicker in the 3.2 SDK? I'm in the middle of porting an iPhone application over to an iPad and that's the one thing I can't seem to get to work. I've tried... -Creating an action sheet, add the picker as a subview and displaying it. -Creating that above action sheet, making it the view of a generic ViewController, adding that VC to a UIPopover -Making just the picker the view of a generic ViewController, adding that VC to a UIPopover With the action sheet it doesn't even attempt to draw it. In the popover view it attempts to draw but doesn't get rendered correctly. Just wanted to check to see if anyone has accomplished this and if so how. Thanks everyone!

    Read the article

  • can I auto update my uitextview from the value of the row of my uipickerview without pressing any se

    - by Wesley
    So I have a uipicker view, that I have managed to load some data from my db into. I would like to update a textview, which is right above the pickerview, with each changing of the row. Is that possible? If I don't have to, I would like to avoid pushing a button in order to show the respective text. Can I make it so that the value in the text field changes with the value of the rowselected in the pickerview, in real time? Any thoughts or code snippets would be appreciated. Thanks!

    Read the article

1 2  | Next Page >