Creating Linked Lists in Objective C

前端 未结 3 470
傲寒
傲寒 2020-12-20 15:36
typedef struct {
    NSString *activty;
    NSString *place;
    float latitude;
    float longitude;
} event;

typedef struct {
    event *thing;
    Node *next;
}          


        
3条回答
  •  伪装坚强ぢ
    2020-12-20 16:01

    You need to name your structure like you would in C. For example:

    typedef struct Node {
        event *thing;
        struct Node *next;
    } Node;
    

    A better question, though, is why do you want to make this linked list in the first place? Why not use one of the container types provided by the framework?

提交回复
热议问题