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

后端 未结 7 1076
佛祖请我去吃肉
佛祖请我去吃肉 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 15:52

    I don't think you can do a binary comparison of a C structure, which is what CGRect is. A quick Google search and checking the C For Dummies Desk Reference didn't turn anything up. You could declare CGRect ppGoalFrame, initialize the members of the structure with default values (if they're not already), and test the structure members.

    Update Edit: This question has been asked for C structures.

提交回复
热议问题