アプリで UITextField を使用しています。を使用して[texfield becomeFirstResponder]
います。これは問題なく機能し、ビューが読み込まれるとキーボードが読み込まれます。ただし、UITextField が表示された後に再度クリックすると、このエラーが発生します。正確な理由はわかりませんが、取得している出力は次のとおりです。
CGContextSetFillColorWithColor: invalid context 0x0.
CGContextSetStrokeColorWithColor: invalid context 0x0.
CGContextSaveGState: invalid context 0x0.
CGContextSetFlatness: invalid context 0x0.
CGContextAddPath: invalid context 0x0.
CGContextDrawPath: invalid context 0x0.
CGContextRestoreGState: invalid context 0x0.
CGContextSaveGState: invalid context 0x0.
CGContextSetFlatness: invalid context 0x0.
CGContextAddPath: invalid context 0x0.
CGContextDrawPath: invalid context 0x0.
CGContextRestoreGState: invalid context 0x0.
これが私のコードです:
// ViewController.h
@interface ViewController : UIViewController
@property (strong, nonatomic) IBOutlet UITextField *textField;
@end
// ViewController.m
@synthesize textField;
- (void)viewDidLoad
{
[textField becomeFirstResponder];
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}