Skip to content

PMAlertController textfield access via objc #86

@Blog404DE

Description

@Blog404DE

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?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions