Objective-C understanding isKindOfClass
问题 Latest version of Objective-C and XCode (4.4). I have a code snippet and I cannot understand why I'm able to use some lines, let me explain : // For understanding purpose : (NSMutableArray*)_programStack id l_topItemOnStack = [_programStack lastObject]; if([l_topItemOnStack isKindOfClass:[NSNumber class]]) { return [l_topItemOnStack doubleValue]; } My question : since my l_topItemOnStack is of type id and I didn't cast it into a NSNumber , how am i able to use the [l_topItemOnStack