Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
643 views
in Technique[技术] by (71.8m points)

iphone - warning: 'UIAlertView' may not respond to '-addTextFieldWithValue:label:'

in my application i was using UIAlertView for login, it contains TextFields, its working perfectly, but i'm getting a warning when i compile the code, i'm using iphone SDK 3.0

code :

loginAlert = [[UIAlertView alloc] initWithTitle:@"Enter the User Name and Password" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Login", nil];
  
[loginAlert addTextFieldWithValue:appDelegate.userName label:@"UserName"];

warning: 'UIAlertView' may not respond to '-addTextFieldWithValue:label:'



txfUserName = [loginAlert textFieldAtIndex:0];

warning: 'UIAlertView' may not respond to '-textFieldAtIndex:'

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This method is private, you should not use it (your app will be rejected). Maybe they removed or renamed it in the latest SDK. For an alternative, see

http://iphonedevelopment.blogspot.com/2009/02/alert-view-with-prompt.html


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...