Prompting and Delegate question


Prompting and Delegate question



I have a class that needs to ask the user a question and wait for the users response to determine the next action. What would be the best way to do this? Using a delegate? How? I have a UITextField and a UITextField in the class.

Thanks


Is anyone testing Mono-Touch? [closed]

1:

How to intercept text from the keyboard and format it before it show in the cell?
It all depends upon how you wish for the user to submit the data. Getting an iPhone app's product name at runtime?The most user friendly way is to did as TahoeWolverine explained and implement - (BOOL)textFieldShouldReturn:(UITextField *)textField from UITextFieldDelegate. declaring global variables in iPhone projectIn rule to use this, the class this implements textFieldShouldReturn: need have <UITextFieldDelegate> protocol in its interface declaration; moreover, the textfield in question need have the UITextFieldDelegate-implementing class set as its delegate. Where's the difference between setObject:forKey: and setValue:forKey: in NSMutableDictionary?In most cases those would look like this:. Why is my UIImageView blurred?
@interface SomeViewController : UIViewController <UITextFieldDelegate> {     UITextField *myField; }  @property (nonatomic, retain) IBOutlet UITextField *myfield @end 
and any where in the implementation:. SHowing Activity Indicator View Using Thread Shows This Error in gdb?
[[self myField] setDelegate:self]; 
Finally, implementing the UITextFieldDelegate protocol:. Unable to push notifications to iPhone in .NET - .PEM certificate problem?
- (BOOL)textFieldShouldReturn:(UITextField *)textField {     if (textField == [self myField]) {          [self doSomethingWithText:[[self myField] text]];     } } 
Hope this helps..

2:

Yes, you should use a delegate, and link this to the keyboard's done although ton (I'm assuming this you're presenting the user a keyboard). Simply link your delegate to the return key of the keyboard, and this should did the trick..


70 out of 100 based on 45 user ratings 720 reviews