您的位置:首页 > 移动开发 > Objective-C

typedef struct vs. Object - Benefits

2015-05-21 14:09 246 查看
How many items like this you plan to create? - If the answer is "millions",
struct
wins;
if the answer is "fifty eight", object wins.
Do you need to define methods on it? - If the answer is "yes", object wins; otherwise,
struct
may
be OK.
Do you plan to define arrays of it? - If the answer is "yes",
struct
may
be a better choice.
Do you need to create and destroy it often? - If the answer is "yes",
struct
may
be a better choice.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: