¥È¥Ã¥×   ÊÔ½¸ Åà·ë º¹Ê¬ ¥Ð¥Ã¥¯¥¢¥Ã¥× źÉÕ Ê£À½ ̾Á°Êѹ¹ ¥ê¥í¡¼¥É   ¿·µ¬ °ìÍ÷ ñ¸ì¸¡º÷ ºÇ½ª¹¹¿·   ¥Ø¥ë¥×   ºÇ½ª¹¹¿·¤ÎRSS

Objective-C

Last-modified: 2018-11-14 (¿å) 15:23:55 (2153d)
Top / Objective-C

TIPS

¥·¥ß¥å¥ì¡¼¥¿¡¼¤È¼Âµ¡¤ò¾ò·ïÉÕ¤­¥³¥ó¥Ñ¥¤¥ë¤Çʬ¤±¤ëÊýË¡

#if TARGET_IPHONE_SIMULATOR
	NSString *hello = @"Hello, iOS simulator!";
#else
	NSString *hello = @"Hello, iOS device!";
#endif

iPhone¤ÈiPad¤Ç½èÍý¤òʬ¤±¤ëÊýË¡

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
 	NSLog(@"iPad¤Î½èÍý");
} else {
 	NSLog(@"iPhone¤Î½èÍý");
}

°úÍѸµ: iPhone¤ÈiPad¤òȽÊÌȽÄꤷ½èÍýʬ¤±¤¹¤ëÊýË¡ | ÏÂÍÎÉ÷

¥ê¥ó¥¯