我正在一个屏幕(即firstScreen)到下一个屏幕(即secondFile)进行导航。我的代码在 firstFile.m 中是:
- (IBAction)onClick:(id)sender
{
secondFile* dest = [[secondFile alloc] initWithNibName:@" secondFile" bundle:nil];
[self.navigationController pushViewController:dest animated:YES];
NSString* uname = txtUserName.text;
NSLog(@"usr name is : %@",uname);
}
第一屏.h
<UIKit/UIKit.h>
@interface nevigationViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIButton *btnNevigation;
@property (weak, nonatomic) IBOutlet UITextField *txtUserName;
- (IBAction)onClick:(id)sender;
@end
问题是打印了日志但没有执行导航。拜托,你能告诉我上面的代码有什么问题吗?