Search Results

Search found 9 results on 1 pages for 'uitextviewdelegate'.

Page 1/1 | 1 

  • UITextView Delegate shouldChangeTextInRange (or any over) doesn't get called

    - by justas wza
    Hello, I need to track changes in my UITextView method (actianly for limiting number of lines), but none of UITextViewDelegate methods are being called when editing in UITextView begins. Not even - (void)textViewDidChange:(UITextView *)textView; I dont know what Im doing wrong I added UITextViewDelegate method to header file like that: @interface PirmasViewController : UIViewController <UITextViewDelegate, MFMa...... And I put any methods for tracking changes in my implementation file: - (void)textViewDidChange:(UITextView *)textView{NSLog(@"something changed");} - (BOOL)textView:(UITextView *)aTextView shouldChangeTextInRange:(NSRange)aRange replacementText:(NSString*)aText{ NSLog(@"something changed"); return YES; }` but no rezults.

    Read the article

  • iphone setting UITextView delegate breaks auto completion

    - by Tristan
    Hi there! I have a UITextField that I would like to enable auto completion on by: [self.textView setAutocorrectionType:UITextAutocorrectionTypeYes]; This works normally, except when I give the UITextView a delegate. When a delegate is set, auto complete just stops working. The delegate has only the following method: - (void)textViewDidChange:(UITextView *)textView { self.textView.text = [self.textView.text stringByReplacingOccurrencesOfString:@"\n" withString:@""]; int left = LENGTH_MAX -[self.textView.text length]; self.characterCountLabel.text = [NSString stringWithFormat:@"%i",abs(left)]; } Does anyone know how to have both auto complete enabled and a delegate set? Thanks!Tristan

    Read the article

  • Limit number of charchters in uitextview !

    - by hib
    Hello All , I am giving a text view to tweet some string . I am applying the following method to restrict the number of characters to 140 in length. - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{ if([text isEqualToString:@"\b"]){ DLog(@"Ohoooo"); return YES; }else if([[textView text] length] > 140){ return NO; } return YES; } The code is working nicely except the first condition that backspace is not working. suppose that I have reached the limit of 140 characters so that the method will give me false and the user can not insert more characters but after that when I try to delete some characters the text view behave as it is disabled . So the question how do delete characters from textview.text or re-enable the text view .

    Read the article

  • Get text from UITextView

    - by John
    Is it possible to get the first line of text from a UITextView. I have looked through the UITextView and NSString Class References and can't find any methods that could accomplish this.

    Read the article

  • how to extend a protocol for a delegate in objective C, then subclass an object to require a conform

    - by fess .
    I want to subclass UITextView, and send a new message to the delegate. So, I want to extend the delegate protocol, What's the correct way to do this? I started out with this: interface: #import <Foundation/Foundation.h> @class MySubClass; @protocol MySubClassDelegate <UITextViewDelegate> - (void) MySubClassMessage: (MySubClass *) subclass; @end @interface MySubClass : UITextView { } @end implementation: #import "MySubClass.h" @implementation MySubClass - (void) SomeMethod; { if ([self.delegate respondsToSelector: @selector (MySubClassMessage:)]) { [self.delegate MySubClassMessage: self]; } } @end however with that I get the warning: '-MySubClassMessage:' not found in protocol(s). I had one way working where I created my own ivar to store the delegate, then also stored the delegate using [super setDelegate] but that seemed wrong. perhaps it's not. I know I can just pass id's around and get by, but My goal is to make sure that the compiler checks that any delegate supplied to MySubClass conforms to MySubClassDelegate protocol. To further clairfy: @interface MySubClassTester : NSObject { } @implementation MySubClassTester - (void) one { MySubClass *subclass = [[MySubClass alloc] init]; subclass.delegate = self; } @end will produce the warning: class 'MySubClassTester' does not implement the 'UITextViewDelegate' protocol I want it to produce the warning about not implementing 'MySubClassDelegate' protocol instead. Thanks, a bunch. (thanks brad)

    Read the article

  • dictationRecordingDidEnd never called

    - by optme
    I am using a UITextView and added UITextInputDelegate in my view controller. I have implemented textDidChange and dictationRecordingDidEnd methods. The textDidChange and dictationRecordingDidEnd are never called. Please help. In MyViewController.h file @interface MyViewController : UIViewController <UITextViewDelegate, UITextInputDelegate> { } In MyViewController.m file - (void) textDidChange:(id<UITextInput>)textInput { } - (void)dictationRecordingDidEnd { } - (void)dictationRecognitionFailed { textViewResults.text = @"Dictation Failed"; }

    Read the article

  • problem with IBoutlet UITableView connection

    - by ideafactory
    Hi,I'm having a problem with IBoutlet UITableView connection. It seems that the IBOutlet isn't connected to the TaleView. I set the delgate and the datasource to the files owner and set the iboutlet to the tableview in the nib. The tableview is well initialized. I just want to do some reloadData and it's not working. I try to do some deselectRow just to see if it isn't reloadData problem but it doesn't deselect so i assume that the iboutlet isn't associated with my tableview. This table view is in a viewcontroller that is called as a modalViewController. Here is some code: My .h file: @interface AddEditProjectsViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, UIActionSheetDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate, UITextViewDelegate, UIAlertViewDelegate>{ IBOutlet UITableView *addEditProjectTable; } @property (nonatomic, retain) IBOutlet UITableView *addEditProjectTable; @end My .m file: - (void)viewWillAppear:(BOOL)animated { (...) [addEditProjectTable reloadData]; [super viewWillAppear:animated]; Thanks for any help! :)

    Read the article

  • Hiding a Bar button item in the view

    - by devb0yax
    How can you able to hide the (done) bar button item in a view? Basically, I have a view controller added with navigation bar (in IB) then, I also added a bar button item into the nav bar. I just want initially the (done) bar button item is hidden.. when input is in the text view the (done) button is already visible. Any idea on this implementation on a view controller? Here's my sample code: @interface MyTextViewViewController : UIViewController <UITextViewDelegate> { UITextView *m_textView; UIBarButtonItem *doneBarButtonItem; } @property(nonatomic,retain) IBOutlet UITextView *m_textView; @property(nonatomic,retain) IBOutlet UIBarButtonItem *doneBarButtonItem; - (IBAction)saveAction:(id)sender; .m file: - (void)viewDidLoad { [super viewDidLoad]; doneBarButtonItem.hidden = YES; --> compile error!!! } - (void)textViewDidBeginEditing:(UITextView *)textView { doneBarButtonItem.hidden = NO; --> compile error!!! } - (IBAction)saveAction:(id)sender { doneBarButtonItem.hidden = YES; --> compile error!!! ... }

    Read the article

  • delegate issues in Xcode

    - by trludt
    .h file #import <UIKit/UIKit.h> @interface AddEventViewController : UIViewController <UITextViewDelegate> @end .m file @property (weak, nonatomic) IBOutlet UITextField *textField1; @property (weak, nonatomic) IBOutlet UITextField *textField2; @property (weak, nonatomic) IBOutlet UITextField *textField3; - (IBAction)textFieldReturn:(id)sender; @end @implementation AddEventViewController @synthesize textField1, textField2, textField3; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (IBAction)textFieldReturn:(id)sender; { [sender resignFirstResponder]; } - (void)viewDidLoad { [super viewDidLoad]; self.textField1.delegate = self; textField1.delegate = self; // Do any additional setup after loading the view. } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (void)touchesBegan: (NSSet *) touches withEvent: (UIEvent *)event { if (textField1) { if ([textField1 canResignFirstResponder]) [textField1 resignFirstResponder]; } [super touchesBegan: touches withEvent: event]; if (textField2) { if ([textField2 canResignFirstResponder]) [textField2 resignFirstResponder]; } [super touchesBegan: touches withEvent: event]; if (textField3) { if ([textField3 canResignFirstResponder]) [textField3 resignFirstResponder]; } [super touchesBegan: touches withEvent: event]; } - (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField1 resignFirstResponder]; return NO; [textField2 resignFirstResponder]; return NO; [textField3 resignFirstResponder]; return NO; } @end Ok so im getting the yellow bug symbol on the lines: - (void)viewDidLoad { [super viewDidLoad]; self.textField1.delegate = self; textField1.delegate = self; } I don't know how to delegate all of my textFields? how do i make this textFieldReturn work for all of my textFields.. that viewDidLoad area has to be the problem, because everything else works good...

    Read the article

1