Why simulator iPhone/iPad are given different results vs iPhone Retina(4-inch) and iPhone Retina(4-inch 64-bit) -


this first time ask questions because new here. answering! appreciate time.

using xcode 5.1.1

here problem, when testing on simulator or actual devices, result comes out different. see screenshot attached on food image. when test on simulator iphone retina(4-inch 64-bit), result correct, food image displays correctly , matching text.

when test on simulator iphone retina(4-inch), result incorrect, food image displays not match text.

i test actual devices, ipad air displays correct ipad3 incorrect. food image displays not matching text.

can me out how solve issue? not understand why same code generates different result.

for (nsuinteger i=0; i<30; i++)  {     uiimage *animage = [uiimage imagenamed:[nsstring stringwithformat:@"food%d.jpg", (int)i+1]];      [arrimagefood addobject:animage]; } [arrforalldicfood addobjectsfromarray:[dictionaryforenglishfood allkeys]]; [tableforfood reloaddata]; 

code moved , formatted multiple comments:

- (void)viewdidload {     [super viewdidload]; dictionaryforenglishfood=[[nsmutabledictionary alloc]init];     dictionaryforlaofood=[[nsmutabledictionary alloc]init];     dictionaryforpythnfood=[[nsmutabledictionary alloc]init];     dictionaryforimagefood=[[nsmutabledictionary alloc]init];     dictionaryforaudiofood=[[nsmutabledictionary alloc]init];     arrforalldicfood=[[nsmutablearray alloc]init];     arrimagefood=[[nsmutablearray alloc]init];      // add english german food     //    [dictionaryforenglishfood setvalue:@"asparagus" forkey:@"food1"];//5     //    [dictionaryforenglishfood setvalue:@"lobscouse" forkey:@"food2"];//29     //    [dictionaryforenglishfood setvalue:@"sauerkraut" forkey:@"food3"];//22     //    [dictionaryforenglishfood setvalue:@"potatoes" forkey:@"food4"]; //16     //    [dictionaryforenglishfood setvalue:@"pumpkin bread" forkey:@"food5"];//11     //    [dictionaryforenglishfood setvalue:@"asparagus sauce" forkey:@"food6"];//6     //    ......      // add german words     //    [dictionaryforlaofood setvalue:@"spargel" forkey:@"food1"];//5     //    [dictionaryforlaofood setvalue:@"labskaus" forkey:@"food2"];//29     //    [dictionaryforlaofood setvalue:@"sauerkraut" forkey:@"food3"];//22     //    [dictionaryforlaofood setvalue:@"pellkartoffeln" forkey:@"food4"]; //16     //    [dictionaryforlaofood setvalue:@"kürbisbrot" forkey:@"food5"];//11     //    [dictionaryforlaofood setvalue:@"spargelsoße" forkey:@"food6"];//6     //    ........      // add german pronounciation     //    [dictionaryforpythnfood setvalue:@"shpahrg-uhl" forkey:@"food1"];//5     //    [dictionaryforpythnfood setvalue:@"lahbs-cows" forkey:@"food2"];//29     //    [dictionaryforpythnfood setvalue:@"sour-krout" forkey:@"food3"];//22     //    [dictionaryforpythnfood setvalue:@"pehl-car-tohf-ehln" forkey:@"food4"]; //16     //    [dictionaryforpythnfood setvalue:@"koorb-is-broht" forkey:@"food5"];//11     //    [dictionaryforpythnfood setvalue:@"shpahrg-uhl-sohs-uh" forkey:@"food6"];//6     //    ......      // add german audio     //    [dictionaryforaudiofood setvalue:@"aspargus" forkey:@"food1"];//5     //    [dictionaryforaudiofood setvalue:@"lobscouse" forkey:@"food2"];//29     //    [dictionaryforaudiofood setvalue:@"sauerkraut" forkey:@"food3"];//22     //    [dictionaryforaudiofood setvalue:@"potatoes" forkey:@"food4"]; //16     //    [dictionaryforaudiofood setvalue:@"pumpkin bread" forkey:@"food5"];//11     //    [dictionaryforaudiofood setvalue:@"aspargus sauce" forkey:@"food6"];//6     //    ....      (nsuinteger i=0; i<30; i++) {         uiimage *animage = [uiimage imagenamed:[nsstring stringwithformat:@"food%d.jpg", (int)i+1]];         [arrimagefood addobject:animage];     }     [arrforalldicfood addobjectsfromarray:[dictionaryforenglishfood allkeys]];     [tableforfood reloaddata]; }   -(uitableviewcell )tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath {     if([[ uidevice currentdevice]userinterfaceidiom]==uiuserinterfaceidiomphone) {         static nsstring *cellidentifier = @"customcellplace";         customcellplace *cell= (customcellplace) [tableview dequeuereusablecellwithidentifier:cellidentifier];      //  create uitableviewcell     //  if(cell == nil) {     //      nsarray *toplevelobjects = [[nsbundle mainbundle] loadnibnamed:@"customcellplace" owner:self options:nil];     //      (id currentobject in toplevelobjects) {     //          if ([currentobject iskindofclass:[uitableviewcell class]]) {     //              cell = currentobject;     //          }     //      }     //  }          cell.tag=indexpath.row;         cell.backgroundcolor = [uicolor clearcolor];         cell.backgroundview = [uiview new] ;         cell.selectedbackgroundview = [uiview new] ;         cell.selectionstyle = uitableviewcellselectionstylenone;           cell.lb1.text=[dictionaryforenglishfood objectforkey:[arrforalldicfood objectatindex:indexpath.row]];         cell.lb2.text=[dictionaryforlaofood objectforkey:[arrforalldicfood objectatindex:indexpath.row]];         cell.lb3.text=[dictionaryforpythnfood objectforkey:[arrforalldicfood objectatindex:indexpath.row]];         for(int i=0; i<[arrimagefood count];i++) {             nsuinteger str=indexpath.row;             cell.imageview.image=[arrimagefood objectatindex:str];         } return cell;     } }   -(nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section {     return [arrforalldicfood count]; } 

the problem here when testing simulator iphone(4 inch) or actual devices iphone5, result(text) not order/match food image running simulator iphone(4 inch 64-bit) matched/order food image. how can change code in order make works both iphone(4 inch) , iphone(4 inch 64-bit).

food image displays order 1-30 text changed somehow have no clue do. again.

iphone retina(4-inch 64-bit) iphone retina(4-inch)

dictionaries not have order `allkeys' method can return order. not guaranteed order same 1 call another. adding, removing or changing entry can result in different order being returned.

what need include image name (or name index) food names in 1 structure. relying on order not solution.

the simulator that, runs code compiled intel processor simulation device. device code compiled arm processor. 1 can expect differences such seeing order of keys correct.

an emulator runs other processors code emulating same instructions , result same order on each device again in order.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -