return • the value of a property of an object. If the property is expressed as a noun, the format is: • - (NSString *)title; • - (void)setTitle:(NSString *)aTitle; • If the property is expressed as an adjective, the format is: • - (BOOL)isEditable; • - (void)setEditable:(BOOL)flag; •
the format is: • - (BOOL)showsAlpha; • - (void)setShowsAlpha:(BOOL)flag; • The verb should be in the simple present tense. • - (void)setAcceptsGlyphInfo:(BOOL)flag; Right. - (BOOL)acceptsGlyphInfo; Right. - (void)setGlyphInfoAccepted:(BOOL)flag; Wrong. - (BOOL)glyphInfoAccepted; Wrong.
and values • indirectly. You should use this form for methods only when multiple items need to be returned. E.g.: • - (void)getLineDash:(float *)pattern count:(int *)count phase:(float • *)phase;
invoked to • notify the delegate that something has happened or is about to happen. E.g.: • - (void)browserDidScroll:(NSBrowser *)sender; • - (NSUndoManager *)windowWillReturnUndoManager:(NSWindow • *)window;
as prefix: • E.g.: kInvalidHandle • #Import/#Include • Import objectiveC; • Include c/c++ • Import whole framework even when only need a few files • #import <Foundation/NSArray.h> • #import <Foundation/Foundation.h> •