简体   繁体   中英

Adding User Input to An Array in Objective-C/Xcode

I am building an app and have run into a bit of an issue. It has been a long process of building and attempting to learn how to build it and code in Objective-C, but it has been fun. Now, I am almost finished with it, but I cannot for the life of me figure out how to generate user input from one file (UITextField) and populate an array with it in another file (UITableView).

Here is some of the code I am using, I am attempting to fill the array as such:

arryData = [[NSArray alloc] initWithObjects:@"@&", textFieldinput, nil];

Any help on how to do something along these lines would be great. Thanks!

Sure - the textFieldinput can report the string it's showing with the text property, so...

arryData = [[NSArray alloc] initWithObjects:@"@&", textFieldinput.text, nil];

..will work better. Best of luck, and keep enjoying it!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM