• 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: Cocoa et al as HCI usability problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa et al as HCI usability problem


  • Subject: Re: Cocoa et al as HCI usability problem
  • From: Andreas Mayer <email@hidden>
  • Date: Mon, 19 May 2008 20:31:02 +0200


Am 19.05.2008 um 13:11 Uhr schrieb Peter Duniho:

I just don't see how declaring an interface and then using it is so inferior to an informal protocol that it justifies the entire message-dispatching paradigm, especially given that there are in fact advantages to the former. At best, it's a wash.

This is (part of) a method that handles an AppleScript command send to the application.
One possible argument is the color to be used for display:


- (id)handleDisplayCommand:(NSScriptCommand *)command
{
	NSDictionary *args = [command evaluatedArguments];
	NSString *colorName = [args objectForKey:@"color"];
	NSColor *color;

	...

if (colorName) {
SEL colorSelector = NSSelectorFromString([colorName stringByAppendingString:@"Color"]);
if ([[NSColor class] respondsToSelector:colorSelector]) {
color = objc_msgSend([NSColor class], colorSelector);
}
}


	...
}

This way you may use any color name that NSColor supports.
You can even just add colors by declaring a category on NSColor and adding the appropriate method.
No changes required in the code above.


I don't have much experience in C++, Java or C#, so I can't comment on those. But I *do* know, that I like it very much that I'm able to do things like that above.


Andreas _______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Cocoa et al as HCI usability problem
      • From: Andy Lee <email@hidden>
References: 
 >Re: Cocoa et al as HCI usability problem (From: Peter Duniho <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: ben syverson <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: Peter Duniho <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Cocoa et al as HCI usability problem (From: Peter Duniho <email@hidden>)

  • Prev by Date: KVO Response for incomplete paths
  • Next by Date: Custom NSPredicateEditorRowTemplate with Single Item
  • Previous by thread: Re: Cocoa et al as HCI usability problem
  • Next by thread: Re: Cocoa et al as HCI usability problem
  • Index(es):
    • Date
    • Thread