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;
<
All instance variables in an Objective-C class are initialized to zero. So all pointers are nil
, numbers are 0, and structs are zeroed. Since the CGRect is a plain struct, it will be initialised to origin.x=0, origin.y=0, size.width=0, size.height=0
.
So to test if your CGRect
has been set, you need to compare it (by value) to zero. The CGRectIsEmpty
function will do exactly this:
if (CGRectIsEmpty(ppGoalFrame))
{
// ...
}