Thank you to everyone who pointed out that I should implement my delegates
based on signatures found in the documentation for NSControl, not NSTextField.
I got the faulty signatures I used from the section of the documentation
labeled 'NSText Delegate Method Implementations'. I guess that from
Am 08.06.2008 um 05:29 Uhr schrieb Andy Lee:
If you look at the docs for NSControl you'll see the following
delegate methods, which may be what you want:
Yes. And since Andy was too humble to mention it, let me do so:
Instead of Apple's online documentation or the Xcode doc browser, you
With regard to my problems with delegates, I think maybe my frustrations stem
from something about the delegation process or about text fields that I do not
understand.
Here is how to recreate an example of my problem.
STEP 1: Start a new project called 'WhatKb'
STEP 2: Add a Cocoa Objective
You can try the following methods
- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText
*)fieldEditor
{
[ MyController logCurrentInputSource ];
return true;
}
- (void)controlTextDidBeginEditing:(NSNotification *)aNotification {
[ MyController
On Jun 7, 2008, at 11:44 PM, Charles Jenkins wrote:
-(BOOL)textShouldBeginEditing:(NSText*)textObject;
-(void)textDidBeginEditing:(NSNotification*)aNotification;
It seems you've set the delegate of the text fields correctly. (To
confirm that they were correctly set by IB, you could NSLog
Hi Charles-
On Jun 7, 2008, at 9:44 PM, Charles Jenkins wrote:
With regard to my problems with delegates, I think maybe my
frustrations stem from something about the delegation process or
about text fields that I do not understand.
There's just a little twist to NSTextField that you are
textShouldBeginEditing: and textDidBeginEditing: are generally methods
you'd override in a subclass. By default they call the
control:textShouldBeginEditing: and controlTextDidBeginEditing: of the
delegate (if there is one). The latter are the methods your delegate
needs to implement.
Am 05.06.2008 um 06:32 schrieb Charles Jenkins:
I had a Nib file that went bad. Suddenly, my outlets doubled up: IB
indicated that a class had two outlets named 'textField1' and
'textField2'.
You sure it went bad? If you have IBOutlets and rename them, IB
sometimes keeps entries for
Am 07.06.2008 um 20:33 schrieb John Pannell:
I think the secret to getting this type of thing right is that the
documentation uses the end of the instance methods list for a class
to call out specifically when methods are delegate methods. Look at
the end of NSControl's list and you can
Am 07.06.2008 um 21:05 schrieb Uli Kusterer:
You sure it went bad? If you have IBOutlets and rename them, IB
sometimes keeps entries for these connections in the NIB file. It
does this since you may be copy-and-pasting in your source files,
and it wouldn't want to trash that connection just
Am 07.06.2008 um 20:29 schrieb Andy Lee:
NSLog( @Current input source '%s', [ name UTF8String ] );
Urrk. bad. You can't expect %s to be UTF8. Instead, do:
NSLog(@Current input source '%@', name );
Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.zathras.de
On Thu, Jun 5, 2008 at 9:32 AM, Charles Jenkins [EMAIL PROTECTED] wrote:
Hi! Despite the fact that you have heard from me before on this list, I am
still an newbie trying to struggle through writing my first Cocoa app.
I have experienced a couple of frustrations that I would like to share to
Hi! Despite the fact that you have heard from me before on this list, I
am still an newbie trying to struggle through writing my first Cocoa app.
I have experienced a couple of frustrations that I would like to share
to see if anyone knows tools or practices that will help avoid them in
the
Am 05.06.2008 um 15:32 Uhr schrieb Charles Jenkins:
I had a Nib file that went bad.
Never had that problem, so I can't help much. But, as you found out,
the best way to fix it is probably to create a completely new nib.
You create an object (.h, .m, and object instance in IB) that a
On 5 Jun 2008, at 11:32 pm, Charles Jenkins wrote:
Hi! Despite the fact that you have heard from me before on this
list, I am still an newbie trying to struggle through writing my
first Cocoa app.
I have experienced a couple of frustrations that I would like to
share to see if anyone
On Jun 5, 2008, at 3:32 PM, Charles Jenkins wrote:
Hi! Despite the fact that you have heard from me before on this
list, I am still an newbie trying to struggle through writing my
first Cocoa app.
I have experienced a couple of frustrations that I would like to
share to see if anyone
16 matches
Mail list logo