For example if I have a function sort() like so:
+ (void) sort: (id) a {
if(typeof(a) == 'NSArray')
{ ... }
}
So is there anything in Objective C for Iphone which can go in place of typeof() so that I can detect beforehand what kind of variable am I dealing with?
Springs to mind.
I do want to point out though that in your case it makes more sense to simply type the method argument, rather than taking id and checking it’s type, i.e.