I am facing this problem of random output of my application at each launch in xcode simulator. I am using xCode Version 4.6.3 . I tried and executed all the steps mentioned in here How to Empty Caches and Clean All Targets Xcode 4 but it didn't help. I am using different resources for different family of devices. (Basically I am making universal iOs app.). Please check below code which I am using in AppDelegate.cpp
CCSize screenSize = pEGLView->getFrameSize();
//set design size for iPad retina
CCSize designSize = CCSize(1536,2048); //1.33
float screenRatio = screenSize.height/screenSize.width;
std::vector<std::string> searchPaths;
if (screenSize.width > 768)
{
searchPaths.push_back("ipadRetina");
}
else if (screenSize.width > 320)
{
if (screenRatio == 1.5f) // && screenRatio < 1.775f)
{
searchPaths.push_back("iphoneRetina");
designSize = CCSize(640,960);
}
else if(screenRatio == 1.775f)
{
searchPaths.push_back("iphoneFive");
designSize = CCSize(640,1136);
}
else
{
searchPaths.push_back("ipad");
}
}
else
{
searchPaths.push_back("iphone");
designSize = CCSize(320,480);
}
CCEGLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionShowAll);
CCFileUtils::sharedFileUtils()->setSearchPaths(searchPaths);
pDirector->setContentScaleFactor(screenSize.height/designSize.height);
Output each time I'm getting is completely random.Sometimes images coming are with extra zoom, after that, if I close the project and rerun it, output (images) comes shrinked. On Next run it comes completely different than previous two outputs.
What I observed from above code is when I am trying to run application for ipadRetina it takes resources,sometimes from iphone folder,sometimes from ipadRetina folder.. but when I put the breakpoint,searchpath is set for ipadRetina folder.
Please help.