开发者

Check if NSRect is null

I'm not able to check if a NSRect structure has a value.

if(!myRect)// produce an error
if(myRect== nil) //this's not a 开发者_运维问答pointer...can't works.

Which is the correct way ?


I think the NSIsEmptyRect function is more comfortable, right?
If you just want to check with the zero rect.


An NSRect is a struct, not a pointer, and therefor it can't be nil or NULL. You can however check if a rect is equal to NSZeroRect with if(NSEqualRects(myRect, NSZeroRect)).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜