objective c - Looking for code to 'set current key' when saving data --iOS App-- -
I've recently posted a question about some issues, I've been saving data in an text field for an app. I'm making that in Xcode. The question can be seen here,
I found a very useful answer, which helped me in the clue, where I was going wrong, but I still needed the code I'm unsure about
- (zero) view in particular: (BOOL) animated [[super visual shape looks: animated]; If (! [Self.tField.text isEqualToString: @ ""]) Set the current time [Data Settronic Content: Self.tField.text]; } Else {// Set Current Current [Data Removed Notifier:: [Data Getting Career]]; } If (! [Self.tField2.text is EqualToString: @ ""]) {// Set Current Current [Data Set Note Foreword: self.tField2.text]; } Else {// Set Current Current [Data Removed Notifier:: [Data Getting Career]]; } [Data Save Notes]; }
I added the second text field to enable the second text field to be saved, but I do not know which code to call different items To do.
- (zero) setNote: (NSString *) for the note: (NSString *) key
A 'current key' Use only makes maintenance of that information a problem you do not need.
In your current code, because you have 2 if
statements, you can set the keys to the code as textual values. This is not very scaleable, so if you proceed, you may want to store your text field in an array and think of another array with the associated key names.
Comments
Post a Comment