Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you reference a textfield and enter it into a mutable array
    primarykey
    data
    text
    <p>So I need to have whatever was entered in a textfield saved into a nsmutablearray (this has to happen multiple times! and each time it must be saved as another object). but whatever I'm doing clearly isn't working, for it says that "text" isn't in the structure or union. Heres my code. thanks for any input! </p> <p>problems are in the enteredClassText method. </p> <pre><code>#import "EnteringCoursesViewController.h" #import "SelectRotationController.h" @implementation EnteringCoursesViewController @synthesize classField; @synthesize indicatedClass; @synthesize labelClassTitle; @synthesize selectRotationController; @synthesize classesEnteredTable; - (IBAction)chooseType { UIActionSheet *typeSheet = [[UIActionSheet alloc] initWithTitle:@"Class types" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"Core Class", @"Elective", nil]; [typeSheet showInView:self.view]; [typeSheet release]; } - (void)actionSheet:(UIActionSheet *)typeSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 0) { self.indicatedClass = classField.text; NSString *indicatedString = indicatedClass; NSString *greeting = [[NSString alloc] initWithFormat:@"%@ meets 6 times per rotation", indicatedString]; labelClassTitle.text = greeting; labelClassTitle.hidden = NO; [greeting release]; [indicatedClass release]; } else if (buttonIndex == 1) { self.indicatedClass = classField.text; NSString *indicatedString = indicatedClass; NSString *greeting = [[NSString alloc] initWithFormat:@"%@ meets 3 times per rotation", indicatedString]; labelClassTitle.text = greeting; labelClassTitle.hidden = NO; [greeting release]; [indicatedClass release]; } } - (IBAction)chooseFirstMeeting:(id)sender { SelectRotationController *selectView = [[SelectRotationController alloc] initWithNibName:@"SelectRotationController" bundle:[NSBundle mainBundle]]; [selectView.navigationItem setTitle:@"First Period Day Choose"]; [self.navigationController pushViewController:self.selectRotationController animated:YES]; self.selectRotationController = selectView; [selectView release]; } - (IBAction)enteredClassText:(id)sender { NSMutableArray *classesEntered = [NSMutableArray arrayWithObject:sender.text]; [classesEntered = [NSMutableArray alloc] init]; [classesEntered release]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } - (void)viewDidLoad { self.navigationItem.hidesBackButton = YES; [super viewDidLoad]; } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [classField release]; [labelClassTitle release]; [indicatedClass release]; [selectRotationController release]; [classesEnteredTable release]; [super dealloc]; } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload