Use Xcode for developing web pages
I want to know if I can develop a web page in Xcode.
I开发者_运维技巧f yes, how?
What is the main difference between a normal web page and a web page for an iPhone, iPod, or iPad? Where should I start?
You can indeed write web pages with Xcode. I was able to do so by creating a new empty project, then creating a new file in it with a .html
extension. Ready to go.
There is no real difference between webpages for normal browsers and iOS devices. Webpages for iOS devices may have special meta
tags changing the viewport and rely on WebKit-specific things, but there's no significant difference.
If you already know HTML, you may want to start at http://developer.apple.com/safari.
As for dynamic web pages, yes, of course. Again, it's not that different from developing dynamic web pages for normal browsers.
No, use DashCode for developing iphone web apps. See Mobile Safari Web Application Tutorial for more info.
Although you can write HTML in Xcode it is really not the best choice. I'd recommend using TextMate, Coda or any of the other thousand text editors available. Alternatively, Dashcode is available and is specifically designed for targeting mobile devices.
Furthermore, if you want to generate dynamic webpages, you are going to need to start using a server side language such as PHP, Java, Ruby, Python, etc. Mac OS X comes with Apache and PHP installed so if it is something trivial this might be your best option.
In my opinion, yes you can use Xcode for web development.
And while Xcode does not target to the web development as other software (like Brackets, DW, etc.) it has a nice feature: a drop-down menu of javascript functions, which would be extremely useful to have in other web development IDEs...
I'm an iOS and Mac developer. I use Xcode all day with Swift and Objective-C.
I recently had the need to work on a small website project. This isn't what I normally do.
I use TextMate as my single-file text editor, alongside Xcode. But I found the app very annoying for working in a web project with multiple files. There's probably a way that the pros set up their editors for working in a project, but it's beyond me at the moment.
I ended up creating a new Xcode Workspace then adding my web files to the sidebar. A workspace is very lightweight and does not contain any of the iOS cruft from a new Xcode project.
This lets me use my standard Xcode project searching, keyboard shortcuts, behaviors, etc. I'm not using any serious "web" features, but at least the basics are the same as the IDE I'm accustomed to for mobile development.
So the answer is yes, Xcode can be used as a web IDE.
It's probably not the best web IDE, and it's probably lacking a lot of the features and conveniences that professional web developers rely on. But it works in a pinch, especially for mobile developers who are already accustomed to Xcode.
精彩评论