With which part?
- (void)textViewDidBeginEditing:(UITextView *)textView {
self.txtDetail.text = [self.txtDetail.text stringByAppendingString:@"Hello!"];
}
How do you mean?
I have a textview on interface builder hooked up to an IBOutlet and a property synthesized in DetailViewController.m (txtDetail)...
I was trying to see to start off with (before even thinking about adding a date) I could just add some text in when the user clicks onto UITextView however that doesn't work either:
PHP:- (void)textViewDidBeginEditing:(UITextView *)textView { self.txtDetail.text = [self.txtDetail.text stringByAppendingString:@"Hello!"]; }
Unless i've got the wrong end of the stick completely on how to run the method?
OK, so that's a sensible start. What have you done to debug it "not working"? Have you checked that the method is being called with an NSLog statement? Have you even set the instance that contains that method as the text view delegate?
DetailViewController.h
@interface DetailViewController : UIViewController <UIPopoverControllerDelegate, UISplitViewControllerDelegate> {
UITextView *txtDetail;
}
@property (nonatomic, retain) IBOutlet UITextView *txtDetail;
- (void)textViewDidBeginEditing:(UITextView *)textView;
DetailViewController.m
@synthesize txtDetail;
- (void)textViewDidBeginEditing:(UITextView *)textView {
NSLog(@"Hello");
self.txtDetail.text = [self.txtDetail.text stringByAppendingString:@"Hello!"];
}
On interface builder ive connected the textview to to file owner txtDetail. Have I missed anything?
Appreciate the help![]()
You need to give as much detail as possible: what connection. Have you connected the delegate property of the text view? If not then you cannot expect to receive delegate messages.
@interface DetailViewController : UIViewController <UITextViewDelegate, UIPopoverControllerDelegate, UISplitViewControllerDelegate> {
myAppDelegate *appDelegate
= (myAppDelegate *)[[UIApplication sharedApplication] delegate];
[[[appDelegate rootViewController] flipsideViewController] myMethod];
I don't see what the code you posted has to do with this at all. That is dealing the an application delegate, not a text view delegate.