Comment obtenir de l'index dans un NSArray?

NSMutableArray*array = [[NSMutableArray alloc]init];

NSArray*Somearray = [NSArray arrayWithObjects:1st Object,2ndObject,3rd Object,4th object,5th Object,nil];

Dans le tableau ci-dessus 1er Objet,2ndObject,3e Objet,4e objet,5e Objet ayant val,le contenu,la conclusion dans chaque index.

for(int i=0;i<[Somearray count];i++)
{

______________

Here the code is there to give each index ,that is having val,content,conclusion ..

After that  val,content,conclusion in each index will be add to Dict..
____________


NSDictionary *Dict = [NSDictionary dictionaryWithObjectsAndKeys:val,@"val",content,@"content",conclusion,@"conclusion",nil];

//Each time adding dictionary into array;

[array addObject:Dict];

}

Ci-dessus Dictionnaire est dans la boucle for et la keyvalue paires seront ajouter 5 fois(Somearray Comte).Array est d'avoir en

array = [{val="1.1 this is first one",content="This is the content of 0th index",conclusion="this is  the conclusion of 0th index"},{val="1.2 this is first one",content="This is the content of 1st index",conclusion="this is  the conclusion of 1st index"},____,____,______,{val="1.5 this is first one",content="This is the content of 4th index",conclusion="this is  the conclusion of 4th index"},nil];

Maintenant, je vais avoir NSString*string = @"1.5";

Maintenant j'ai besoin de l'index où val est d'avoir de 1,5 à elle.Comment envoyer de la str dans tableau pour trouver l'indice.

Quelqu'un peut-il partager le code s'il vous plaît.

Merci d'avance.

InformationsquelleAutor Univer | 2011-11-11