objective c - NSTextView autocompletion delegate method not called from popup window -


i programmatically call complete: call nstextview autocompletion delegate method:

- (nsarray *)control:(nscontrol *)control textview:(nstextview *)textview completions:(nsarray *)words forpartialwordrange:(nsrange)charrange indexofselecteditem:(nsinteger *)index 

i have 2 tables, 1 in main sheet, , other 1 in popup window. popup window modally opened sheet.

both tables have column same subclass of nstextview. both tables have delegate same file owner, delegate method called table in main sheet.

the strange thing other delegate methods correctly called table in popup window:

- (bool)control:(nscontrol *)control textshouldendediting:(nstext *)fieldeditor - (bool)control:(nscontrol *)control isvalidobject:(id)object - (bool)tableview:(nstableview *)atableview shouldedittablecolumn:(nstablecolumn *)atablecolumn row:(nsinteger)rowindex 

update:

about nstableview structure:

the tables cell-based nstableview. column made nstextfieldcell i've subclassed. code below subclassed nstextfieldcell.

the method returns subclass, named cbautocompletetextfield, time inheriting nstextview, text editor inside cell.

- (nstextview *)fieldeditorforview:(nsview *)acontrolview {     return [[[cbautocompletetextfield alloc] init] autorelease]; }  

so in end, class invoking complete: subclass of nstextview.

try if helps, perform auto completion need call complete: in text fields field editor using below delegate method:-

- (void)controltextdidchange:(nsnotification *)notification {     if( autocomplete ){         return;     } else {         autocomplete = yes;         [[[notification userinfo] objectforkey:@"nsfieldeditor"] complete:nil];     } } 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -