-
Notifications
You must be signed in to change notification settings - Fork 184
PMAlertController textfield access via objc #86
Copy link
Copy link
Closed
Labels
Description
Hi,
i’m using PMAlertController (installed via pod) within a objc app. After some issues with with pods, i’ve removed my pods-folder and reinstalled every pod.
After re-installing i’ve got some build-errors in connection with textFields inside the alert controller.
My (relevant) code:
PMAlertController *quittungDatenAlert = [[PMAlertController alloc] initWithTitle:@"Blahfasel Title“ description:@"Blahfasel-Description:“ image:nil style:PMAlertControllerStyleWalkthrough];
[quittungDatenAlert addTextField:^(UITextField *textField) {
[textField setPlaceholder: @"Betrag erhalten von"];
[textField setKeyboardType:UIKeyboardTypeDefault];
}];
PMAlertAction* alertSend = [[PMAlertAction alloc] initWithTitle:@"OK" style:PMAlertActionStyleDefault action:^{
NSString *quittungsVon;
quittungsVon = [[[quittungDatenAlert textFields] firstObject] text]
(...)
}];
[quittungDatenAlert addAction:alertSend];
[self presentViewController:quittungDatenAlert animated:YES completion:nil];Instead of accessing the textfield, Xcode now created the following build error:
No visible @interface for 'PMAlertController' declares the selector ‚textFields'
How else could you access the text fields or where is the error?
Reactions are currently unavailable