Re: Using NSClassFromString
Re: Using NSClassFromString
- Subject: Re: Using NSClassFromString
- From: Chris Hanson <email@hidden>
- Date: Fri, 26 Dec 2003 11:10:11 -0600
On Dec 26, 2003, at 6:58 AM, Ramakrishna Kondapalli wrote:
I have created id aNamesClass by using NSClassFromString(@"myClass").
myClass has a static/class variable and I want to access that through
aNamesClass. Does anybody know how to do this?
Objective-C doesn't have true class variables. You'll need to use
accessor methods in the class to manipulate the value of your global
variable.
Furthermore, your code should read
Class myClass = NSClassFromString(@"myClass");
since the result from NSClassFromString is a Class, not an id.
-- Chris
--
Chris Hanson <email@hidden>
bDistributed.com, Inc.
Outsourcing Vendor Evaluation
Custom Mac OS X Development
Cocoa Developer Training
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.