Overview
Setup for development involves some time-consuming downloads and installations, but it is not complicated. We'll use Cydia to install a compiler, assembler and linker on the device. Then we'll download the iPhone SDK from Apple and install it on your computer, and finally we'll copy the header files and framework binaries (if necessary) from the SDK to the device. After that, you are all set to compile code for the device on the device!
Install the Compiler, Assembler and Linker
First you need to install libgcc which the compiler installation depends on: install libgcc.
Then, on your device, go to Cydia -> Sections -> Development -> GNU C Compiler and install. It includes Darwin CC Tools, the assembler and linker. If the packages don't show up in Cydia, then you may have to go to Manage -> Settings and declare yourself a developer first.
Download and Install the SDK
Now you need to get your hands on the iPhone SDK. The iPhone SDK requires an Intel-based Mac running OSX Snow Leopard 10.6.2 or later.
iFuntastic uses the device for compilation, so you can use this computer and OS; however, to install the SDK (and copy its header files,) you need to have a Snow Leopard partition. You can register as a developer with Apple (for free) and download the SDK.
The SDK is a archive, so there is that... Once it's downloaded, follow the instructions to install it, then continue here.
Install
After installation, the SDK(s) are in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/. As long as no SDK has been found or set by you, iFuntastic will look on all mounted volumes for and, if found, enter it into the SDK button at the bottom.
Click to select another one (e.g. from another Volume.) Select a folder that ends in .sdk.
Click the Install button. iFuntastic will copy all the 'Headers' folders from the SDK frameworks to the respective Framework folders on the device. It will also copy the framework binaries if necessary. Note that iFuntastic cannot deal properly with symbolic links. In case of the Headers, only IOKit contains a link - and, luckily, that appears to be invalid, so it is skipped. iFuntastic will also copy all the contents of the /usr/include/ folder to the device, replacing any older or modified versions (if any.) You may want to back up that folder first.
Additionally, the Dev101 application will be installed. It reports the progress of a build on the device.
SDK Documentation
The SDK comes with extensive documentation describing all the classes you can use in your programs - it would be a shame not to make use of it! After copying the headers, iFuntastic will copy the documentation into the Projects folder and produce an index page. You can get to the index page with the 'SDK Documentation' link on top of the /dev/101 window. It will open in your web browser. Carry the documentation from one computer to another with the save and restore commands in the options menu on the lower right.