Mastering Xcode 4 by Joshua Nozzi
Author:Joshua Nozzi
Language: eng
Format: mobi, epub
Publisher: Peachpit Press
Published: 2012-02-15T10:00:00+00:00
* * *
Tip
The WebKit.h header is an “umbrella” header that includes any other headers in the WebKit framework. Referencing this header includes all headers from WebKit.
* * *
That’s it. Run the application. You might have to fish around for the second window (look behind the one you’re familiar with), but it should be waiting there with Google loaded and ready for a search (Figure 15.5). Go ahead and try it out.
Figure 15.5 A working WebView showing Google.com
Negative Reinforcement
Now break it. To prove that the power to use a Web view comes from linking against WebKit.framework, unlink it. Navigate back to the TestApp target in the project, and then remove WebKit.framework from the Link build phase. Try running the app. I dare you. The app should terminate on launch on signal SIGABRT and spew a bunch of messages and a stack trace into the debugger console. The most interesting console message is the second one, that mentions “cannot decode object of class (WebView),” which is a good indicator you’re referencing symbols from a library that hasn’t been loaded (usually because you haven’t linked against it). To fix it again, just add WebKit.framework back into your Link build phase.
Third-Party Framework Example
Third-party frameworks require a little more work to use. Since they aren’t a part of the operating system, they must be distributed with the application. The most common way to do this is to embed the framework inside the application bundle so that it goes along for the ride when the user installs your application.
Adding a Framework to the Project
Most third-party frameworks are open source and many must be built before they can be used in your project. For this example, you can download a simple (and almost entirely useless) framework called Foo.framework from this book’s Web site. The direct download URL is http://files.xcodebook.com/fooframework/FooFramework.zip. Download the file and unzip its contents. You should see a folder titled Foo.framework.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Android | E-Readers |
Handheld & Mobile Devices | iPad |
iPhone | Programming & App Development |
Tablets |
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(6532)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6413)
Kotlin in Action by Dmitry Jemerov(5062)
Odoo 15 Development Essentials - Fifth Edition by Daniel Reis & Greg Mader(3340)
Odoo 15 Development Essentials by Daniel Reis(2814)
React Native - Building Mobile Apps with JavaScript by Novick Vladimir(2529)
Learning Angular - Second Edition by Christoffer Noring(2358)
Pride and Prejudice by Jane Austen(2350)
Mobile Forensics Cookbook by Igor Mikhaylov(2017)
Computers For Seniors For Dummies by Nancy C. Muir(1995)
Bulletproof Android: Practical Advice for Building Secure Apps (Developer's Library) by Godfrey Nolan(1872)
Android Development with Kotlin by Marcin Moskala & Igor Wojda(1797)
Building Android UIs with Custom Views by Raimon Ràfols Montané(1789)
1936941139 (N) by Bob Rosenthal(1731)
Building Progressive Web Apps: Bringing the Power of Native to the Browser by Ater Tal(1725)
Hands-On Internet of Things with MQTT by Tim Pulver(1706)
Android App Development by Franceschi Hervé J.;(1702)
Ember.js in Action by Joachim Haagen Skeie(1689)
Hands-On Design Patterns with React Native by Mateusz Grzesiukiewicz(1656)
