Tuesday, August 23, 2011

iPhone Post image for Synchronization Using Grand Central Dispatch

http://www.fieryrobot.com/blog/category/iphone/

iPhone
Post image for Synchronization Using Grand Central Dispatch
Synchronization Using Grand Central Dispatch

by Ed on September 1, 2010
A Watchdog Timer in GCD

by Ed on July 10, 2010
A Simple Job Queue With Grand Central Dispatch

by Ed on June 27, 2010
Being a Blockhead

iPhone
Post image for Synchronization Using Grand Central Dispatch
Synchronization Using Grand Central Dispatch

by Ed on September 1, 2010
A Watchdog Timer in GCD

by Ed on July 10, 2010
A Simple Job Queue With Grand Central Dispatch

by Ed on June 27, 2010
Being a Blockhead

by Ed on June 20, 2010
Threading is Dead. Long Live Threading!

by Ed on June 12, 2010
My Journey To Tweetsville

by Ed on November 15, 2008
Tweetsville Update

by Ed on November 4, 2008
The Simple Beauty of clearColor

by Ed on October 22, 2008
Tweetsville

by Ed on October 11, 2008
A Small Trick for Provisioning Profiles

iPhone SDK Tutorial Chapters. Table Views

http://www.bogotobogo.com/XcodeSDK-Chapter7.html

Thursday, August 18, 2011

An iOS 4 iPhone Graphics Drawing Tutorial using Quartz 2D


An iOS 4 iPhone Graphics Drawing Tutorial using Quartz 2D

As previously discussed in Drawing iOS 4 iPhone 2D Graphics with Quartz, the Quartz 2D API is the primary mechanism by which 2D drawing operations are performed within iOS iPhone applications. Having provided an overview of Quartz 2D as it pertains to iOS development for the iPhone in that chapter, the focus of this chapter is to provide a tutorial that provides examples of how 2D drawing is performed. If you are new to Quartz 2D and have not yet read Drawing iOS 4 iPhone 2D Graphics with Quartz it is recommended that you do so now before embarking on this tutorial.

Monday, August 15, 2011

http://www.modejong.com/iOS/

Greetings iPhone / iOS developers.

This page exists to help developers by providing working examples of interesting things one might want to do with the iPhone / iOS SDK (updated for Xcode 3.2.5 and iOS 4.2). This information is intended for developers only. The source code is provided "as is" and is placed in the public domain.

1. UITableView with multiple levels
2. PNG Animation
3. Reading/Writing CAF files with the ExtendedAudioFile API
4. PCM Mixer built with CoreAudio
5. AutoPropertyRelease class
6. Implementing audio fade out with CoreAudio
7. 7zip decompresson SDK

Example 1 : UITableView with multiple levels

Do you find the UITableView class a bit hard to use? I found myself wishing there was an easier way to quickly setup a multiple level table, so I created this example. It provides code that implements a multiple level table and provides a simple way to define a class that will be shown when a specific table cell is selected. The table supports sections, but it is limited to text only labels for table cells. Just download and open up in Xcode, then take a look at the TextTableData class to see how to customize a table.
TextTableExample.zip (30Kb)
Example 2 : PNG Animation

Ever want to pull your hair out while dealing with MPMoviePlayerController? The most lame part of the iPhone SDK has got to be MPMoviePlayerController, it is so lacking in functionality that you basically need to roll your own audio/video implementation to do anything interesting. One thing I needed to do was show a simple animation in a loop, but MPMoviePlayerController could not do what I needed it to. There is also the UIImageView.animationImages API, but it quickly sucks up all the system memory when using more than a couple of decent size images. I wanted to show a full screen animation that lasts 2 seconds, at 15 FPS that is a total of 30 PNG images of size 480x320. This example implements an animation oriented view controller that simply waits to read the PNG image data for a frame until it is needed. Instead of alllocating many megabytes, this class run in about a half a meg of memory with about a 5-10% CPU utilization on a 2nd gen iPhone. This example has also been updated to include the ability to optionally play an audio file via AVAudioPlayer as the animation is displayed.
PNGAnimatorDemo.zip (165Kb)
Example 3 : Reading/Writing CAF files with the ExtendedAudioFile API

CoreAudio is really quite a challenge to work with, the main reason is a lack of working examples to demonstrate how to use CoreAudio APIs. I recently ran into a problem when playing two audio streams with 2 AVAudioPlayer instances. The music in the two tracks would not stay in sync, so I decided to dive into CoreAudio and fix the problem by mixing the tracks before sending them to the audio device. This meant that I needed to be able to read the pcm audio data from two audio files, but the audio files I am using are IMA4 compressed caff files and it was not obvious how to read them on the iPhone. After many many hours of searching through mailing lists and example code, I learned that the right way to do this is with the ExtendedAudioFile API in the AudioToolbox framework. This API supports reading or writing from caff audio files with IMA4 compression (one can also decode/encode AAC audio files on 3g and newer iPhones and the iPad). This example shows how to make use of the ExtendedAudioFile to read a IMA4 compressed file and how to write a IMA4 compressed file to disk. Just open up the example in Xcode and run in the Simulator to see how it works. I hope this saves you many many long hours of searching through CoreAudio docs.
ExtAudioFileDemo.tar.bz2 (30Kb)
Example 4 : PCM Mixer built with CoreAudio

This example is a really simple pcm mixer that reads data using the regular AudioFile API. This example provides the solution to the audio sync problem mentioned in the previous example. Once two audio streams have been mixed, the audio can be played with a single AVAudioPlayer, so you will not need to mess around with audio graphs. This example includes an iPhone application example and a command line util that works on Mac OS X. You can test the mixing functionality on the desktop before putting it on the phone (really handy if you want to generate a checksum for the mixed audio). This download is rather large because it includes a couple of unmixed pcm audio files. Note that this mixer does not implement any sort of audio limiter, if the mixed audio would clip then the mixer will return an error code.
MixTwoAudioFilesDemo.tar.bz2 (2300Kb)
Example 5 : AutoPropertyRelease class

Why on earth does one need to release refs to retained properties in Objective-C? The compiler should just do that automatically, it already has all the info about the properties. I find that most memory leaks happen when one changes the properties but then forgets to update the dealloc method to ensure that all the properties are cleaned up. The entire process is just so error prone that I ended up writing this class to do it automatically. Your code would look like this:

#import "AutoPropertyRelease.h"

@implementation MyClass
@synthesize ...;

- (void) dealloc {
[AutoPropertyRelease releaseProperties:self thisClass:[MyClass class]];
[super dealloc];
}

ObjcDestructor.zip (24Kb)
Example 6 : Implementing audio fade out with CoreAudio

I recently ran into a situation where I needed to be able to truncate an audio file to a shorter length. It is easy to truncate by just copying audio data up to a certain number of samples, but this naive approach sounds quite bad. The audio volume needs to fade out at the end of the clip, and the fade must use a log scale. The attached file contains a Python implementation of a fade out algorithm along with a Mac OS X command line program and an iPhone example app. The fade out algorithm will fade to -60 dB over an envelope, both the truncate length and the envelope length can be configured. The envelope fade table is pre-calculated so that the algorithm will run efficiently on even a 1st gen iPhone. This software demonstrates use of CoreAudio and ExtAudioFile API in AudioToolbox Framework.
ClipFade.tar.bz2 (110Kb)
Example 7 : 7zip decompresson SDK

7zip is a useful replacement for zlib and bzip2. In some cases, 7zip can achive drastically better compression ratios than both zlib and bzip2. One can always go to http://www.7-zip.org/ to find the source code. This example provides the lzma SDK (release 9.21 beta) configured as an iPhone project. Only the decompression modules are included, and CRC checking is disabled to improve performance. A simple Objective-C interface is included to support decompressing .7z archives included as iOS project resources.
lzmaSDK.zip (98Kb)


Happy Hacking!
Mo DeJong

Custom fonts in iOS.

Custom fonts in iOS.

Your designer has given you this super snazzy custom font for your app.

Now what?!


http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application/809307#809307
http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application/809307#809307

http://stackoverflow.com/questions/1371407/has-anyone-had-success-using-custom-otf-fonts-on-the-iphone


http://iosfonts.com/

Wednesday, August 10, 2011

iphone swing About Iphone programming & design

http://iphoninandouts.wordpress.com/

http://www.ifans.com/forums/showthread.php?t=132024

Want to create a drawing app? Here you go. Clearly, you will need to make improvements to the drawing code, as I literally spent five minutes making this to test something for another app. Regardless, you should be able to get the gist of what's going on. What I am linking is just your basic standard xcode view based project. The only pertinent part of this are the touchsBegan, touchesMoved, and touchesEnded methods, which I will be posting in this thread.

Wednesday, August 3, 2011

twiter and facebook

http://amanpages.com/sample-iphone-example-project/twitteragent-tutorial-tweet-from-iphone-app-in-one-line-code-with-auto-tinyurl/

iPhone and iPad development

iPhone and iPad development

http://www.scoop.it/t/iphone-and-ipad-development/p/3574121/iphone-sample-code-tiles-undefined-value

http://amanpages.com/sample-iphone-example-project/twitteragent-tutorial-tweet-from-iphone-app-in-one-line-code-with-auto-tinyurl/

Collection of open source applications for the iPhone

http://edigitales.org/collection-of-open-source-applications-for-the-iphone/
http://edigitales.org/collection-of-open-source-applications-for-the-iphone/

http://maniacdev.com/2010/06/35-open-source-iphone-app-store-apps-updated-with-10-new-apps/

http://maniacdev.com/2010/06/35-open-source-iphone-app-store-apps-updated-with-10-new-apps/

Open Source iPhone Apps List – Real App Store Code Examples!