Memory management of structs

Discussion in 'iOS Apps' started by chen8002004, May 24, 2011.

  1. chen8002004 macrumors newbie

    May 22, 2011
    Most discussion about memory management of Objective-C is based on classes derived from NSObject. How about the memory management of a struct? Is it similar to standard C++ memory management (using new and delete)? An example struct is shown as follows:
    typedef struct
    int startPosition;
    int endPosition;
    int Velocity;
    } carInfo;
  2. psonice macrumors 6502a

    Jul 22, 2005
    It's straight C memory management, if you malloc() it, you need to free() it.

Share This Page