|
|
![]() |
|
|
1. Making an HTTP Connection in iPhone Application
|
|
By: Jonathan Zdziarski : 2010-09-06
|
|
Description: You can use the CFHTTP API to create an HTTP request. This allows you to easily invoke HTTP GET, HEAD, PUT, POST, and most other standard requests. Creating a request involves the three-step process of creating the request object, defining the HTTP request message and headers, and serializing the message into raw protocol. Only HTTP POST requests generally contain a message body, which can contain POST form data to send. All other requests use an empty body while embedding the request parameters into the headers. |
|
Read the full article
|
|
2. Making an FTP Connection in iPhone Application
|
|
By: Jonathan Zdziarski : 2010-09-06
|
|
Description: The CFFTP API is similar to the CFHTTP API, and relies on read streams to transmit FTP data. To create an FTP request, use the CFReadStreamCreateWithFTPURL function, as shown below. This will create the initial read stream to the FTP server: |
|
Read the full article
|
|
3. Directory Structure for iPhone Applications
|
|
By: Jonathan Zdziarski : 2010-09-05
|
|
Description: Apple came up with an elegant way to contain applications in their operating system. As OS X is a Unix-based platform, Apple wanted to make it adhere to basic Unix file conventions, and so the resource forks of olde were no longer sufficient (or efficient, for that matter). The challenge was to design a structure that would allow an application to remain self-contained while surviving on a file system that didn't believe in cheapening its architecture with proprietary workarounds. The answer came from an older ancestor of Mac OS X named NeXT, which treated an application as a bundle represented within a directory. The bundle concept introduces an approach to group application resources, binaries, and other related files. |
|
Read the full article
|
|
4. Tools for Cocoa Programming
|
|
By: Aaron Hillegass : 2010-09-03
|
|
Description: All the tools for Cocoa development come as part of the Mac OS X Developer Tools, and you get them for free with Mac OS X. Although the developer tools will add about a dozen handy applications to your system, you will use primarily two applications: Xcode and Interface Builder. Behind the scenes, the GNU C compiler (gcc) will be used to compile your code, and the GNU debug |
|
Read the full article
|
|
5. What is Cocoa? A brief history of Cocoa.
|
|
By: Aaron Hillegass : 2010-09-03
|
|
Description: The story of Cocoa starts with a delightful bit of history. Once upon a time, two guys named Steve started a company called Apple Computer in their garage. The company grew rapidly, so they hired an experienced executive named John Sculley to be its CEO. After a few conflicts, John Sculley moved Steve Jobs to a position in which he had no control over the company at all. Steve Jobs left to form another computer company, called NeXT Computer. |
|
Read the full article
|
|
7. Objects, Classes, Methods, and Messages in Cocoa Programming
|
|
By: Aaron Hillegass : 2010-09-03
|
|
Description: What is an object? An object is like a C struct: It takes up memory and has variables inside it. The variables in an object are called instance variables. So when dealing with objects, the first questions we typically ask are: How do you allocate space for one? What instance variables does the object have? How do you destroy the object when you are done with it? |
|
Read the full article
|
|
8. Frameworks in Cocoa Programming
|
|
By: Aaron Hillegass : 2010-09-03
|
|
Description: A framework is a collection of classes that are intended to be used together. In other words, the classes are compiled together into a reusable library of code. Any related resources are put into a directory with the library. The directory is renamed with the extension .framework. You can find the built-in frameworks for your machine in /System/Library/Frameworks. |
|
Read the full article
|
|
9. Life Cycle of a Cocoa Application
|
|
By: Aaron Hillegass : 2010-09-03
|
|
Description: Let's briefly discuss the chronology of an application: When the process is started, it runs the NSApplicationMain function, which creates an instance of NSApplication. The application object reads the main nib file and unarchives the objects inside. The objects are all sent the message awakeFromNib. Then the application object checks for events. |
|
Read the full article
|
Next
|
|
![]() |
|