A linked list is useful in C for processing dynamic-length lists. This is not a problem in objective-C, since you have NSMutableArray .
So the equivalent is:
struct my_list { int value; struct my_list *next; }; struct my_list list1; struct my_list list2; list1.next = &list2; list1.value = 5; list2.value = 10;
Will be:
NSMutableArray* array = [[NSMutableArray alloc] init]; [array addObject:[NSNumber numberWithInt:5]]; [array addObject:[NSNumber numberWithInt:10]];
Of course, you can use the classic linked list in an objective-C application.
source share