Wednesday, September 25, 2013

Get superior view uinavigationcontroller navigation error occurs unrecognized selector

posts by AGanQ_0223 on 2013-04-10 11:43:42 Edit
Heroes, help
I used uinavigationcontroller of viewControllers objectAtIndex method to get a superior VIEW, but on access to superiors VIEW text boxes in the text assignment, reported unrecognized selector sent to instance error. , Or tell my other superiors can VIEW the text to a text box assignment method is very, very grateful!
The following is my code
# 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:
indexPath];
newCell.accessoryType = UITableViewCellAccessoryCheckmark;

UITableViewCell * oldCell = [tableView cellForRowAtIndexPath:
lastIndexPath];
oldCell.accessoryType = UITableViewCellAccessoryNone;
lastIndexPath = indexPath;
}
[TableView deselectRowAtIndexPath: indexPath animated: YES];

calcontentView = [[CUTTruningCalcontentViewController alloc] init];

calcontentView = [self.navigationController.viewControllers objectAtIndex: ([self.navigationController.viewControllers count] -4)];
NSLog (@ "back to the root directory");
calcontentView.qxclText.text = @ "Test";
/ /

[Self.navigationController popToViewController: [self.navigationController.viewControllers objectAtIndex: ([self.navigationController.viewControllers count] -4)] animated: YES];


}

@ End

Where calcontentView.qxclText.text = @ "Test"; This line error
2013-04-10 11:33:12.487 CutingPro [1256: c07] back to the root directory
2013-04-10 11:33:12.487 CutingPro [1256: c07] - [CUTTurningCalpageController qxclText]: unrecognized selector sent to instance 0x71d4210
2013-04-10 11:33:12.488 CutingPro [1256: c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '- [CUTTurningCalpageController qxclText]: unrecognized selector sent to instance 0x71d4210'
*** First throw call stack:
(0x1ca2012 0x10dfe7e 0x1d2d4bd 0x1c91bbc 0x1c9194e 0x79df 0xd3285 0xd34ed 0xadd5b3 0x1c61376 0x1c60e06 0x1c48a82 0x1c47f44 0x1c47e1b 0x1bfc7e3 0x1bfc668 0x23ffc 0x1f8d 0x1eb5)
libc + + abi.dylib: terminate called throwing an exception
Reply:
Ensure qxclText is not calcontentView of public property, and then make sure that you get the
calcontentView = [self.navigationController.viewControllers objectAtIndex: ([self.navigationController.viewControllers count] -4)];
Is CUTTruningCalcontentViewController instance.

Then say it,
calcontentView = [[CUTTruningCalcontentViewController alloc] init];
calcontentView = [self.navigationController.viewControllers objectAtIndex: ([self.navigationController.viewControllers count] -4)];

This is what you mean? Create a CUTTruningCalcontentViewController object, and then assign it another, why do you want to create a new object?
Reply:
Agents will be able to achieve with a simple assignment to a higher view

No comments:

Post a Comment