.h
@interface HuntProfileView : UIViewController
@property (strong, nonatomic) NSString *huntgroupTitle;
@property (strong, nonatomic) NSString *huntgroupId;
@property (strong, nonatomic) NSArray *lines;
@end
.m
@interface HuntProfileView ()
@property (weak, nonatomic) IBOutlet UITextField *huntgrouptitleText;
@property HuntLineTable *childView;
@end
@implementation HuntProfileView
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"huntgroupTitle %@", self.huntgroupTitle);
self.huntgrouptitleText.text = self.huntgroupTitle;
}
instantiation, assignment & execution
^{
HuntProfileView *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"HUNTVIEW"];
viewController.huntgroupId = huntId;
viewController.huntgroupTitle = title;
[self.navigationController pushViewController:viewController animated:YES];
}
viewController.huntgroupTitle = title;
is correct, or at least title is the string as expected.
The NSLog in .m
outputs as:
2015-01-21 09:47:42.267 changeView[1108:16196] huntgroupTitle <UITextField: 0x7fa9a8fc8480; frame = (16 63; 568 30); text = ''; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x7fa9a8fc9c70>>
2015-01-21 09:47:42.267 changeView[1108:16196] -[UITextField rangeOfCharacterFromSet:]: unrecognized selector sent to instance 0x7fa9a8fc8480
2015-01-21 09:47:42.270 changeView[1108:16196] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITextField rangeOfCharacterFromSet:]: unrecognized selector sent to instance 0x7fa9a8fc8480'
Update:
I'm able to get successful execution when assigning self.huntgroupTitle
a literal string ("hello, world"). Debugging has shown that at instantiation, both the input string of title
as well as viewController.huntgroupTitle
are confirmed to be the correct type.