开发者

Auto import for Xcode

Is it possible for Xcode to auto import the frameworks and class headers automatically?

What happens is that every t开发者_运维技巧ime I build, I will encounter errors due to missing import. I know how to fix, but I felt Xcode can be more intelligent by perhaps giving me an option to "Auto fix imports".


At the moment it's not possible to do that. I suppose what you want is something like Eclipse's auto-import, i.e. when you first use a class in code, it auto-imports the package.

You should open a bug report here to let the Apple people know about it.


I know the question is old, but it is good to know that @import was added to LLVM with XCode 5. It gives you features that you wanted. You can find more here and here


You can import a class header into all files automatically by adding it in the .pch file. You will still need to add the frameworks manually though.


AppCode has the auto import feature. In my opinion it's not an Xcode replacement, but a welcome addition. It has some killer features like multi caret editing, refactoring that actually works, auto import, tabs that don't drive me nuts, structured code view, etc. Give it a try, you owe it to yourself.


If you install Alcatraz (package manager for xcode) then you can search for "Auto Importer" and you should be good.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜