• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Does textDidEndEditing lunches other class methods?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Does textDidEndEditing lunches other class methods?


  • Subject: Does textDidEndEditing lunches other class methods?
  • From: Lorenzo Puleo <email@hidden>
  • Date: Fri, 15 Nov 2002 22:02:38 +0100

Hi,
I made a NSTextField subclass "MyTextField" which is the delegate of a
NSTextField field.
When the users presses TAB during the editing, so he exits from the field, I
want to launch a method of another class. e.g.

- (void)textDidEndEditing:(NSNotification *)aNotification
{
[super textDidEndEditing:aNotification];
NSLog(@"Check Done");
[MyMainClass saveToDisk];
}

But it doesn't work. I see the log string "Check Done", but I cannot launch
that MainClass method. I need to launch that method because most of the
variables and objects I need to control are stored in that class.
May someone help me? Thank you.

This is the header:
===================
/* MyTextField */

#import <Cocoa/Cocoa.h>


@interface MyTextField : NSTextField
{
}
@end

This is the code:
===================
#import "MyTextField.h"
#import "MyMainClass.h"

@implementation MyTextField
- (id)init
{
self = [super init];
return self;
}


- (void)textDidEndEditing:(NSNotification *)aNotification
{
[super textDidEndEditing:aNotification];
[MyMainClass saveToDisk];
}
@end


This is the code of the MainClass:
===================
- (void)saveToDisk
{
[[myField objectValue] writeToFile:@"/txt" atomically:YES];
}

What is wrong?

--
Lorenzo
mailto:email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Does textDidEndEditing lunches other class methods?
      • From: Marco Binder <email@hidden>
    • Re: Does textDidEndEditing lunches other class methods?
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: Interface/usability question
  • Next by Date: Re: Files and arrays
  • Previous by thread: Re: System Config Framework - is this legal?
  • Next by thread: Re: Does textDidEndEditing lunches other class methods?
  • Index(es):
    • Date
    • Thread