On 19.07.2008, at 13:03, Jean-Daniel Dupas wrote:
Because "one" don't now that "Class" are just NSObject and can be use like any other objects.
Yeah, if the sample code really is like it's actually implemented, and it wasn't simplified for posting, just placing the result of [NSlass class] into an array would be a better idea.
That said, I've implemented plugin schemes where plugin authors put the class names as strings in plist files and then we used NSClassFromString() to get the class the plugin developer requested. That's effectively what NSApplication and NSBundle do when you ask for the application class/main class to use.
Of course, stuff like that is a tad dangerous if you have to fear some other people feeding you malicious class names, so don't use NSClassFromString([NSString stringWithFormat: @"NS [EMAIL PROTECTED]",currentHTMLTagName]) to implement your web browser unless you want to cope with people creating NSXMLElements for you to get your browser to crash... :-)
Cheers, -- Uli Kusterer "The Witnesses of TeachText are everywhere..." http://www.zathras.de _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]