我有两个屏幕,一个用于登录:类名是 LoginViewController。截图是
它由两个文本字段组成,用户名和密码。
点击忘记密码:这个屏幕打开这个屏幕的类是 ForgotPasswordViewController
在点击 DOB 文本字段时,会出现一个日期选择器选择器,从中选择一个日期。现在,如果我按下后退按钮,则会出现登录屏幕。到目前为止一切都很好。现在,如果我点击用户或密码文本字段,那么应用程序崩溃将记录此日志
2013-11-13 13:55:53.582 mRx[4684:60b] *** -[ForgotPasswordViewController respondsToSelector:]:消息发送到已释放实例 0x15d7b510
我不知道是什么导致了这次崩溃。请提出一些处理它的建议。我已经使用了 2 天,但还没有找到解决方案。如果您需要有关此的任何其他信息,请发表评论。
错误线索的屏幕截图是这样的:
请帮忙
文本字段带来日期选择器的代码是这样的:
#pragma mark - TextField Delegate Methods
- (void)textFieldDidBeginEditing:(UITextField *)textField{ self.txt_currentFocusedTextField = textField; [[AppDelegate sharedInstance] addToolbarForKeyboard:textField];
if (textField == self.txt_DOB) {
[textField resignFirstResponder];
_actionSheetPicker = [[ActionSheetDatePicker alloc] initWithTitle:@"" datePickerMode:UIDatePickerModeDate selectedDate:self.selectedDate minimumDate:Nil maximumDate:Nil target:self action:@selector(dateWasSelected:element:) origin:textField];
self.actionSheetPicker.hideCancel = NO;
[self.actionSheetPicker showActionSheetPicker];
}
}
.h 文件中的代码是这样的:
#import <UIKit/UIKit.h>
#import "AbstractActionSheetPicker.h"
@interface ForgotPasswordViewController : UIViewController<UITextFieldDelegate>
@property (strong,nonatomic) UITextField * txt_currentFocussedTextField;
@property (strong,nonatomic) IBOutlet UITextField *txt_username;
//@property (weak,nonatomic) IBOutlet UITextField *txt_lastname;
@property (strong,nonatomic) IBOutlet UITextField *txt_DOB;
@property (strong,nonatomic) IBOutlet UITextField *txt_phone;
@property (strong,nonatomic) IBOutlet UITextField * txt_zip;
@property (strong,nonatomic) IBOutlet UITextField * txt_newPassword;
@property (strong,nonatomic) IBOutlet UIButton *btn_save;
@property (strong,nonatomic) IBOutlet UIScrollView * scrollview;
@property (nonatomic, strong) AbstractActionSheetPicker *actionSheetPicker;
@property (nonatomic, retain) NSDate *selectedDate;
- (void)forgotPasswordRequest;
@end