メモ

iPad と iPhone 両方に対応したアプリを作ろうと思ったとき、View の配置とかで、端末の判定をする場合、こんな感じで判定できそうです。

(※ iOS 5 で試してます。)

 1. iPad 用の処理を書きたいとき

    if ([[UIDevicecurrentDevice] userInterfaceIdiom] == 

UIUserInterfaceIdiomPad) {

// iPad 専用の処理を記述

    }

2. iPhone用の処理を書きたいとき

    if ([[UIDevicecurrentDevice] userInterfaceIdiom] ==

UIUserInterfaceIdiomPhone) {

// iPhone 専用の処理を記述

    }

iPodも iPhone と同じくくりでやればいいのかも。