Re: Instance an from an NSString Class name

2010-09-21 Thread koko
Word up to Seth and Jerry! I'll be a Cocoa engineer yet! -koko On Sep 21, 2010, at 11:07 PM, Seth Willits wrote: On Sep 21, 2010, at 9:21 PM, k...@highrolls.net wrote: NSString *class = [NSString stringWithCString:[data bytes] encoding:NSASCIIStringEncoding]; Class obst

Re: Instance an from an NSString Class name

2010-09-21 Thread Seth Willits
On Sep 21, 2010, at 9:21 PM, k...@highrolls.net wrote: > NSString *class = [NSString stringWithCString:[data bytes] > encoding:NSASCIIStringEncoding]; > Class obstacle = NSClassFromString(class); > id thisObstacle = [[obstacle alloc] initWithImage:[sender

Re: Instance an from an NSString Class name

2010-09-21 Thread Jerry Krinock
On 2010 Sep 21, at 21:21, k...@highrolls.net wrote: > However, must I retain [sender draggedImage] so the code becomes: > > id thisObstacle = [[obstacle alloc] initWithImage:[[sender draggedImage] > retain] andLocation:[sender draggingLocation]]; No. Your 'obstacle' should retain its 'image' a

Re: Instance an from an NSString Class name

2010-09-21 Thread koko
Thanks! Now I have: NSString *class = [NSString stringWithCString:[data bytes] encoding:NSASCIIStringEncoding]; Class obstacle = NSClassFromString(class); id thisObstacle = [[obstacle alloc] initWithImage:[sender draggedImage] andLocation:[sender draggingLocation]];

Re: Instance an from an NSString Class name

2010-09-21 Thread Roland King
NSClassFromString A method I always have trouble remembering and never find when I search. On Sep 22, 2010, at 12:01, k...@highrolls.net wrote: > Given an NSString which is the name of a class what voodoo do I perform to > create an instance of that class? > > -koko > __

Re: Instance an from an NSString Class name

2010-09-21 Thread Stephen J. Butler
On Tue, Sep 21, 2010 at 11:01 PM, wrote: > Given an NSString which is the name of a class what voodoo do I perform to > create an instance of that class? Use NSClassFromString(). ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not po

Instance an from an NSString Class name

2010-09-21 Thread koko
Given an NSString which is the name of a class what voodoo do I perform to create an instance of that class? -koko ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact th