开发者

Objective-C / Xcode project : Where to put structs?

I always try to keep my Xcode projects very well organized but I recently asked myself where to put struct data types.

Normal I use a lot of classes even when a struct would do. Sin开发者_如何学Goce classes are always separate files there are much easier to organize and easier to find.

Where do you put your structs?


I try to follow the patterns employed by the system as much as possible. In particular, look to the definitions of NSRect, NSPoint, and other structures.

In other words, group together structures that are related into a single header file. For many projects, that would lead to exactly one header full of structure declarations.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜