Is the id type really dynamic (late binding at runtime) or similar to the 'var' keyword in C # (late binding at compile time)?
From the Objective-C Programming Language :
id is defined as a pointer to the data structure of the object:
typedef struct objc_object { Class isa; } *id;
and more importantly
id . , , . - , . id , .isa - . () ( ) ., . , , , , . ( , . Objective-C .) Objective-C , .
id . , , . - , . id , .
isa - . () ( ) .
, . , , , , . ( , . Objective-C .) Objective-C , .
. ( ). . , :
Class classes[3]; classes[0] = [NSMutableString class]; classes[1] = [NSMutableArray class]; classes[2] = [NSMutableData class]; srandom(time(NULL)); id foo = [[classes[random % 3] alloc] init]; NSLog(@"It is a %@", [foo class]);
Source: https://habr.com/ru/post/1774203/More articles:ListView task: it does not jump to the selected item - c #О алгоритме сокращения кода - algorithmjquery.parents () - jqueryКак JPA обрабатывает частичное, непересекающееся наследование (используя InheritanceType.JOINED в сценарии класса за стол) вместе с EntityManager.find()? - inheritanceWhich socket-based model should be used for many simultaneous connections? - c ++how to associate stream_socket_client with interface in php? - phpMigrating subsets of production data back to dev - ruby | fooobar.comHow to populate a rational database of several MySQL tables from an existing database from one table? - databaseFirst time with this error - Inconsistent availability - c #Did I find an error in the AS3 XML class? - xmlAll Articles