i am stack in this error use of undeclared identifier vary common error and sometimes very easy to fix but i am anyway stack, probably i am watching in the wrong way.
I am trying to do a log book where people can write what they want and save in plist.
From a tableView, where I will show al the files saved, i will push to a xib view where the person can fill up the fields. I’ve already imported the .h for the new and from the .h where I define my keys.
Here where the error is coming out.
- (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
name.text = [bookLog objectForKey:NAME_KEY];
placeTextView.text = [bookLog objectForKey:PLACE_KEY];
file1TextView.text = [bookLog objectForKey:FILE1_KEY];
file2TextView.text = [bookLog objectForKey:FILE2_KEY];
}
4 errors for bookLog 1 for each line and 1 for name.text, placeTextView.text, file1TextView.text, fileTextView.text.
Any idea?
Thanks
The properties you refer to in diveLogTable.m are not members of the diveLogTable class, so the compiler sees them as undefined when you mention them there. They are defined publicly on the diveLogDetails class, so they can be accessed there (or by asking an instance of that class for them).
The code that’s not compiling can be moved into the diveLogDetails class. It’s what you want to do when that view controller’s view will appear (set up the UIControls). It will compile there, and it seems to make sense there.
It looks to me like you have some diveLog information held in the diveLog dictionary, and you’d like to present that data to the user and allow edits via the diveLogDetails class (it’s conventional to start class names with a capital letter and name view controllers with that suffix, like this: DiveLogDetailsViewController).
The diveLog dictionary on the diveLogDetails class is the only property that ought to be public. When you create the diveLogDetails VC, set the dictionary as you have it.
Let the diveLogDetails read the values from the dictionary, setup it’s UIControls, alter the dictionary values when the user changes the values of the controls (and taps save, or whatever). Upon return to the diveLogTable, the up-to-date values will be in the dictionary.