I m attempting to piece together and run a list of tasks put together by a user. These task lists can be hundreds or thousand of items long.
From what I know, the easiest and most obvious way would be to build an array and then iterate through them:
NSArray *arrayOfTasks = .... init and fill with thousands of tasks
for (id *eachTask in arrayOfTasks)
{
if ( eachTask && [eachTask respondsToSelector:@selector(execute)] ) [eachTask execute];
}
For a desktop, this may be no problem, but for an iphone or ipad, this may be a problem. Is this a good way to go about it, or is there a faster way to accomplish the same thing?
The reason why I m asking about how much overhead a msg_send occurs is that I could also do a straight C implementation as well. For example, I could put together a linked list and use a block to handle the next task. Will I gain anything from that or is it really more trouble than its worth?