各位大侠,求救
我用uinavigationcontroller 的viewControllers objectAtIndex方法获取了上级的VIEW,但在对获取的上级VIEW中的text文本框进行赋值操作时,报unrecognized selector sent to instance 错误。,或者告诉我其他能向上级VIEW的text文本框赋值的方法,非常,万分感谢!
以下是我的代码
#import "CUTTurningQxclSelect3.h"
#import "CUTTruningCalcontentViewController.h"
@interface CUTTurningQxclSelect3 ()
@end
@implementation CUTTurningQxclSelect3
@synthesize list;
@synthesize lastIndexPath;
CUTTruningCalcontentViewController *calcontentView;
- (void)viewDidLoad {
[super viewDidLoad];
NSArray *array = [[NSArray alloc] initWithObjects:@"Q195",
@"Q215A", @"Q215B", nil];
self.list = array;
}
- (void)viewDidUnload {
[super viewDidUnload];
self.list = nil;
self.lastIndexPath = nil;
}
#pragma mark -
#pragma mark Table Data Source Methods
- (NSInteger)tableView:(UITableView *)tableView
numberOfRowsInSection:(NSInteger)section {
return [list count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CheckMarkCellIdentifier = @"CheckMarkCellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:
CheckMarkCellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CheckMarkCellIdentifier];
}
NSUInteger row = [indexPath row];
NSUInteger oldRow = [lastIndexPath row];
cell.textLabel.text = [list objectAtIndex:row];
cell.accessoryType = (row == oldRow && lastIndexPath != nil) ?
UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
return cell;
}
#pragma mark -
#pragma mark Table Delegate Methods
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
int newRow = [indexPath row];
int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1;
if (newRow != oldRow) {
UITableViewCell *newCell = [tableView cellForRowAtIndexPath: