A “single line of code” browser with Cocoa

I really enjoy developing on Mac OS X… especially thanks to XCode and Cocoa (what a superb framework)!

What makes Cocoa such a great tool is letting you concentrate on your project making easy accessing to all those low-level “stuff” that always slow down your work! For example… it is possible to create an essential browser writing down just a single line of code (of course after making the UI graphically with Interface Builder)!

Once you’ve set up the UI with a textfield, a button and a webview all you need to write is:

[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString: [urlText stringValue]]]];

Don’t you think that all this is so cool? I mean… for example, if you’re working on an RSS aggregator you can just spend time working on the core task of the application avoiding the waste of time derived from implementing a built-in browser for rendering news!

You can download the xcode project of “single line of code browser” clicking here!


One Response to A “single line of code” browser with Cocoa

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: