How do you optionally use iPhone OS 3.0 features in a 2.0 compatible app?

Apple has an example of how to do this, specifically making a 2.x-compatible app that uses MFMailComposeViewController…. http://developer.apple.com/iphone/library/samplecode/MailComposer/index.html the answer involves compiling with the 3.0 SDK, setting the deployment target to 2.x, ensuring that the 3.0 frameworks are marked as “weak” references, and then doing the right thing to make your code work if you’re … Read more

Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape?

I found a much better way that works independent of the nav controller. Right now, I have this working when embedded in a nav controller, and when NOT embedded (although I’m not using the nav controller right now, so there may be some bug I’ve not seen – e.g. the PUSH transition animation might go … Read more

Detecting the iPhone’s Ring / Silent / Mute switch using AVAudioPlayer not working?

Well I found the answer thanks to someone from the Developer Forums, and you guys aren’t gonna like it! I’ve had a response from Apple on this. They’ve said they don’t and never have provided a method for detecting hardware mute switch and don’t intend to do so. 🙁 IMO there is definitely value in … Read more

How to include and use new fonts in iPhone SDK?

Add the font files to your resource files Edit your Info.plist: Add a new entry with the key Fonts provided by application. For each of your files, add the file name to this array On the example below, I’ve added the font “DejaVu Sans Mono”: In your application you can the use [UIFont fontWithName:@”DejaVuSansMono-Bold” size:14.f]. … Read more

How to intercept touches events on a MKMapView or UIWebView objects?

The best way I have found to achieve this is with a Gesture Recognizer. Other ways turn out to involve a lot of hackish programming that imperfectly duplicates Apple’s code, especially in the case of multitouch. Here’s what I do: Implement a gesture recognizer that cannot be prevented and that cannot prevent other gesture recognizers. … Read more