Kurt
Kurt

Reputation: 137

Need new way to add a UITextField to a UIAlertView

So my app was rejected (it has been approved every other time i have put it in for review and I hadn't touched this code path in ages) or this line:

[myAlert addTextFieldWithValue:nil label:NSLocalizedString(@"Name",@"Name")];

Apparently addTextFieldWithValue:label: is a private API... so how are we supposed to put a UITextField inside an AlertView?

Can someone help?

Upvotes: 1

Views: 603

Answers (2)

Alex Reynolds
Alex Reynolds

Reputation: 96937

Consider using a modal view controller, instead. No risk of app rejection.

Upvotes: 2

Marc W
Marc W

Reputation: 19241

You don't. Alert views are for displaying alerts only. Apple uses them to display text fields sometimes, but that's their prerogative (since they wrote the HI guidelines and all).

Find a different approach in your UI for prompting the user for data. This is a mobile platform, not a desktop. Using popups like this for information gathering on such a platform is usually inappropriate.

Upvotes: 0

Related Questions