Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: substitute class at runtime?




Le 19 juil. 08 à 08:12, Kyle Sluder a écrit :

On Sat, Jul 19, 2008 at 1:10 AM, Andy Lee <email@hidden> wrote:
Am I misunderstanding?

No, I assure you that I'm the one who misunderstood. Although now the question is why would one use an array of strings when one could use an array of Class objects... maybe because the strings are coming from elsewhere.

Because "one" don't now that "Class" are just NSObject and can be use like any other objects.



Class cls = [MyViewController class]; BOOL isObject = [cls isKindOfClass:[NSObject class]]; // returns YES

And it even responds to copy and copyWithZone: and so can be used as a key in an NSDictionary.




_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >substitute class at runtime? (From: Nathaniel Gottlieb-Graham <email@hidden>)
 >Re: substitute class at runtime? (From: Andy Lee <email@hidden>)
 >Re: substitute class at runtime? (From: "Kyle Sluder" <email@hidden>)
 >Re: substitute class at runtime? (From: Andy Lee <email@hidden>)
 >Re: substitute class at runtime? (From: "Kyle Sluder" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.