开发者

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

开发者 https://www.devze.com 2022-12-12 11:26 出处:网络
I always try to keep my Xcode projects very well organized but I recently asked myself where to put struct data types.

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

精彩评论

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