0

I want to create an application that work with iphone 3 and 4.
so I have images for iphone 3 and others for 4.
now I want my application to load resources based on ios version the part of detecting ios version is easy. the problem is that i want to know how to create new NSBundle and use it to make application load resources from different bundle based on detected ios version.

vikingosegundo
  • 52,040
  • 14
  • 137
  • 178
Ali
  • 1

1 Answers1

-1

if your resource is only concerned with image then you are not required to put any extra effort to do that. Suppose you have a image named myHome.png for 3 then rename the same image for 4 to myHome@2x.png. It will automatically take that image if the device is iPhone4.

If the resource is any thing other than image then you need to do conditional coding i.e you need to check for a condition every time you are trying to access such resource and the code will look something like this

1 to check if its iPhone of iPad do this

NSString *deviceType = [UIDevice currentDevice].model;
if([deviceType isEqualToString:@"iPhone"])
{
     //do your work for iPhone
}

2 To check between iOS version you can try this link this the best I know

Community
  • 1
  • 1
Amit Singh
  • 8,383
  • 4
  • 28
  • 31