Default value of an Objective-C struct and how to test

后端 未结 7 1100
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-31 15:33

I\'m trying to test if a property has been set yet. I know that with objects that I\'ve got:

CGRect ppGoalFrame;
LocalPlaySetup *localPlaySetup;
<
7条回答
  •  情歌与酒
    2021-01-31 16:01

    Actually there is an obvious and elegant solution (lol):

    SomeStruct someStruct = {0};

    Which just fills all the "elements" of the struct with zeroes.

提交回复
热议问题