Re: Comparing the Class

2008-10-15 Thread Ken Ferry
Ferry <[EMAIL PROTECTED]> wrote: > > > From: Ken Ferry <[EMAIL PROTECTED]> > > Subject: Re: Comparing the Class > > To: "Graham Cox" <[EMAIL PROTECTED]> > > Cc: "cocoa-dev Dev" > > Date: Wednesday, October 15, 2008, 6:59 PM > > &

Re: Comparing the Class

2008-10-15 Thread Michael Ash
On Wed, Oct 15, 2008 at 6:17 PM, Melissa J. Turner <[EMAIL PROTECTED]> wrote: > It's generally unwise to do this kind of thing if you're dealing with class > clusters or bridged classes (which category includes both NSString and > NSNumber). The class you actually get may not be what you're expecti

Re: Comparing the Class

2008-10-15 Thread Chris Idou
A category could be a nice OO solution here that avoids having the dreaded if else. --- On Wed, 10/15/08, Ken Ferry <[EMAIL PROTECTED]> wrote: > From: Ken Ferry <[EMAIL PROTECTED]> > Subject: Re: Comparing the Class > To: "Graham Cox" <[EMAIL PROTECT

Re: Comparing the Class

2008-10-15 Thread Graham Cox
On 16 Oct 2008, at 12:59 pm, Ken Ferry wrote: A category can add a protocol adoption, actually. Cool, I didn't know that :) Obj-C is a great language, isn't it? --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Re: Comparing the Class

2008-10-15 Thread Ken Ferry
> > Hi, >> >> when comparing the class of two objects I usually do [obj1 >> isKindOfClass:[obj2 class]]. But if I say have the Class as an input value >> to a method: >> >> - (void) bla:(Class) inClass >> { >>if (/* inClass is an NSString *

Re: Comparing the Class

2008-10-15 Thread Graham Cox
On 16 Oct 2008, at 12:20 am, Ruotger Skupin wrote: Hi, when comparing the class of two objects I usually do [obj1 isKindOfClass:[obj2 class]]. But if I say have the Class as an input value to a method: - (void) bla:(Class) inClass { if (/* inClass is an NSString

Re: Comparing the Class

2008-10-15 Thread Melissa J. Turner
On Oct 15, 2008, at 06:20, Ruotger Skupin wrote: Hi, when comparing the class of two objects I usually do [obj1 isKindOfClass:[obj2 class]]. But if I say have the Class as an input value to a method: - (void) bla:(Class) inClass { if (/* inClass is an NSString

Re: Comparing the Class

2008-10-15 Thread Mike Abdullah
On 15 Oct 2008, at 14:20, Ruotger Skupin wrote: Hi, when comparing the class of two objects I usually do [obj1 isKindOfClass:[obj2 class]]. But if I say have the Class as an input value to a method: - (void) bla:(Class) inClass { if (/* inClass is an NSString

Comparing the Class

2008-10-15 Thread Ruotger Skupin
Hi, when comparing the class of two objects I usually do [obj1 isKindOfClass:[obj2 class]]. But if I say have the Class as an input value to a method: - (void) bla:(Class) inClass { if (/* inClass is an NSString */) { // do stuff } else if