![]() The reason for the PCH is to improve build times when dealing with really massive headers (like in UIKit). You should still import UIKit.h or Foundation.h as needed, as the Xcode templates do. ![]() The PCH file isn't there to get rid of listing dependencies. This is especially important for categories, which can make code very hard to reuse if they're implicit. When you reuse your view controller in a new project (which is common if you build your controllers well), you will immediately know what it requires. In that case you can create one and pass it into clang, but it's incredibly rare that it's a good idea.ĮDIT: To your specific question about a HUD you use in all your view controllers, yes, you should absolutely import it into every view controller that actually uses it. Avoid them until you have a serious build time problem that you can demonstrate is dramatically improved with a prefix header. I would like to hear from you guys opinion. so I told him why not use namespace (Entity.User ie.) to make it specific but he against it. and he says he do this becasuse if he wants to make User.aspx Users get mixed. Prefix headers make code reuse hard, and introduce subtle build problems if any of the files listed can change. My project leader uses project based prefixes for class names, lets say projects name ABC, he create User class name as ABCUser. If you have something that huge and ubiquitous, you should rethink your architecture. The prefix header was necessary for things that are huge and used by nearly everything in the whole system (like Foundation.h). If you do need macros, put them in a header and include it. Stop writing macros unless there is no other way (such as when you need _FILE_). Put your definitions into their own files. Put your imports into the files that need them. Īs to where to put code that you would put in a prefix header, there is no code you should put in a prefix header. In the finder go to the project folder: the project file -> Right click on your project file. I suspect because of modules, which remove the need for the #import. I know that its late but it might be helpful for people who need to change the Bundle Identifier of the app.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |