• 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
Re: Setting focus to text field in drawer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting focus to text field in drawer


  • Subject: Re: Setting focus to text field in drawer
  • From: "Alastair J.Houghton" <email@hidden>
  • Date: Mon, 11 Aug 2003 10:48:28 +0100

On Monday, August 11, 2003, at 02:06 am, Seth Willits wrote:

On Sunday, August 10, 2003, at 05:53 PM, publiclook wrote:

How about

[[_searchField window] makeKeyAndOrderFront:nil];

Will that work? I suppose it might, but since NSDrawer isn't a window I figured you couldn't do it that way. Cool if it works!


Also, Apple reserves all variable names that start with just one underscore and don't have a unique prefix. I suggest

_xxSearchField where xx is an two characters appropriate to your application.

I didn't know that. I've been using them all over since I saw in another project. I thought it was used to keep your variables from colliding with message names or something.

Also, the C standard reserves a lot of names starting with underscores... specifically

"- All identifiers that begin with an underscore and either an uppercase letter
or another underscore are always reserved for any use.

- All identifiers that begin with an underscore are always reserved for use as
identifiers with file scope in both the ordinary and tag name spaces."

I don't think, though, that these restrictions (or Apple's) apply to struct/class/union member variables; it seems to be quite common to use "_" as a prefix for private/protected member variables, in ObjC as well as in C++ and Java.

Additionally, in ObjC it seems to be conventional to use "_" as a prefix for implementation-specific methods that you do not wish users of your class to call.

BTW, variables and message names can't collide; it's perfectly OK to define a class

@interface foo : NSObject
{
int number;
}

- (int)number;
@end

and you can still write

@implementation foo
- (int)number
{
return number;
}
@end

Kind regards,

Alastair.
_______________________________________________
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.

References: 
 >Re: Setting focus to text field in drawer (From: Seth Willits <email@hidden>)

  • Prev by Date: Re: #Import problems
  • Next by Date: Re: GCC3?
  • Previous by thread: Re: Setting focus to text field in drawer
  • Next by thread: Re: Setting focus to text field in drawer
  • Index(es):
    • Date
    • Thread