I am trying to create a block in Objective-C, at runtime, from a char *string. But I can't find the way to do it.
I think that the dynamic nature of Objective-C would allow to do something like
char *blockString = "^(int a, int b) {return a + b;};";
printf("%s\n", blockString);
int (^addBlock)(int a, int b) = (^)*blockString;
int result = addBlock(3, 6);
Obviously, the syntax of the third line is too wacky for the compiler to process, but I hope it gives you the idea of what I want to accomplish.
Is this possible?