iCulture forum | iPhone, iPad,  iPod touch, Apple TV en iOS

iCulture forum | iPhone, iPad, iPod touch, Apple TV en iOS (https://forum.iculture.nl/)
-   Ontwikkelen voor iOS (https://forum.iculture.nl/f133/development/f58/ontwikkelen-voor-ios/)
-   -   Dynamic Class Loading (https://forum.iculture.nl/f133/development/f58/ontwikkelen-voor-ios/41804-dynamic-class-loading.html)

markvwijnen 16-08-09 16:48

Dynamic Class Loading
 
Heej,

Is het mogelijk om classes dynamisch in te laden?

Stel ik heb twee verschillende classes: Gras en muur. En noem ze als class Tile1.m en Tile2.m, die de gemeenschappelijke class Tile.m overerven.

Ik zou graag iets hebben als Tile *tile = [[@"Tile1" alloc] init];

Gr Mark

P-development 16-08-09 21:15

Code:

[[NSClassFromString(@"Tile1") alloc] init];

markvwijnen 16-08-09 21:17

Awesome thanks!


Alle tijden zijn GMT +2. Het is nu 17:06.