Copyright 2004 by M. Uli Kusterer Fri, 29 Nov -1901 11:06:32 GMT Comments on article blog-lookup-tables-for-fun-and-profit at Zathras.de http://www.zathras.de/angelweb/blog-lookup-tables-for-fun-and-profit.htm blog-lookup-tables-for-fun-and-profit Comments witness_dot_of_dot_teachtext_at_gmx_dot_net (M. Uli Kusterer) witness_dot_of_dot_teachtext_at_gmx_dot_net (M. Uli Kusterer) en-us Comment 1 by Jean-Daniel http://www.zathras.de/angelweb/blog-lookup-tables-for-fun-and-profit.htm#comment1 http://www.zathras.de/angelweb/blog-lookup-tables-for-fun-and-profit.htm#comment1 "SEL theCommand = NSSelectorFromString(caseCorrectedCommand);
if( theCommand == nil )"

I don't think it's possible for NSSelectorFromString to return nil, even with a typo in your dictionary (except maybe if an objc runtime error occured). Whatever the string is, the runtime should create a new selector, or return an existing one.


This is what the NSSelectorFromString ref says:

Discussion
To make a selector, NSSelectorFromString passes a UTF-8 encoded character representation of aSelectorName to sel_registerName and returns the value returned by that function. Note, therefore, that if the selector does not exist it is registered and the newly-registered selector is returned.