-3

When I try to define my constants here, I don't have any experiences about iPod:

#define isIPhone (![[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] || [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)

Can anyone know how to define the iPod models?

Alessandro Ornano
  • 34,887
  • 11
  • 106
  • 133
  • Did a rollback to the previous version of the question. Removing the code makes the question very broad. – Sulthan Feb 28 '16 at 11:53
  • This code was correct and it's writed in many other answers , I use it in my app pubblication without any problem, negative vote because it's unliked by one person may draw people into error.I try to delete all question without success. – Alessandro Ornano Feb 28 '16 at 16:26
  • You cannot delete the question because already has accepted answers, you can flag it for deletion if you want but don't remove the code because the question does not make sense without it. – Sulthan Feb 28 '16 at 16:50
  • I didnt know this flag. Thank you sir. – Alessandro Ornano Feb 28 '16 at 16:51

1 Answers1

0

Use the properties of [UIDevice currentDevice]: UIDevice reference

Branching based on resolution is definitely a bad idea.

See also: UIDevice currentDevice model possible values

As this info is not going to change at run time, it is worth querying it once at the beginning, rather than calling the corresponding API at each specific conditional.

Community
  • 1
  • 1
jmihalicza
  • 2,083
  • 12
  • 20