The arry has value as==>
arry = 1~Below - $0.99,2~$1.00 - $1.99,3~$2.00 - $2.99,4~$3.00 - Above;
i want NSDictionary to be filled with above values in sequential order (ASC/DSC) with key value pair...
but the ordering is not proper!!!!!!!!!!!
Also Checkout the index value of NSDicitonary why are they not incrementing by 1 like 0,1,2,3,4....
the Log file shows following
count=4
when i=3;
when i=2;
when i=1;
arry = 1~Below - $0.99,2~$1.00 - $1.99,3~$2.00 - $2.99,4~$3.00 - Above;
i want NSDictionary to be filled with above values in sequential order (ASC/DSC) with key value pair...
but the ordering is not proper!!!!!!!!!!!
Also Checkout the index value of NSDicitonary why are they not incrementing by 1 like 0,1,2,3,4....
Code:
- (void)requestFinished:(ASIHTTPRequest *)request
{
NSString *responseString = [request responseString];
NSArray *arry;
arry= [responseString componentsSeparatedByString:@","];
for (int i=[arry count]-1; i>=0; i--) {
NSArray *arryValue = [[arry objectAtIndex:i] componentsSeparatedByString:@"~"];
[dictPrice setObject:[arryValue objectAtIndex:1] forKey:[arryValue objectAtIndex:0]];
}
}
the Log file shows following
count=4
when i=3;
Code:
Printing description of dictPrice:
<CFDictionary 0xc038cfc0 [0x1e3bca0]>{type = mutable, count = 2, capacity = 3, pairs = (
[COLOR="Red"]0 [/COLOR]: <CFString 0xcc820ff0 [0x1e3bca0]>{contents = "4"} =
<CFString 0xcc822fe0 [0x1e3bca0]>{contents =[COLOR="Red"] "$3.00 - Above"[/COLOR]}
[COLOR="red"]3[/COLOR] : <CFString 0xcc86eff0 [0x1e3bca0]>{contents = "3"} =
<CFString 0xcc870fe0 [0x1e3bca0]>{contents =[COLOR="red"] "$2.00 - $2.99"[/COLOR]}
)}
when i=2;
Code:
Printing description of dictPrice:
<CFDictionary 0xc038cfc0 [0x1e3bca0]>{type = mutable, count = 3, capacity = 3, pairs = (
[COLOR="red"]0[/COLOR] : <CFString 0xcc820ff0 [0x1e3bca0]>{contents = "4"} =
<CFString 0xcc822fe0 [0x1e3bca0]>{contents =[COLOR="red"] "$3.00 - Above"[/COLOR]}
[COLOR="red"]1[/COLOR] : <CFString 0xcc8ceff0 [0x1e3bca0]>{contents = "2"} =
<CFString 0xcc8d0fe0 [0x1e3bca0]>{contents =[COLOR="red"] "$1.00 - $1.99[/COLOR]"}
[COLOR="red"] 3 [/COLOR]: <CFString 0xcc86eff0 [0x1e3bca0]>{contents = "3"} =
<CFString 0xcc870fe0 [0x1e3bca0]>{contents = [COLOR="red"]"$2.00 - $2.99[/COLOR]"}
)}
when i=1;
Code:
Printing description of dictPrice:
<CFDictionary 0xc038cfc0 [0x1e3bca0]>{type = mutable, count = 4, capacity = 6, pairs = (
[B][COLOR="Red"]0 [/COLOR][/B]: <CFString 0xcc820ff0 [0x1e3bca0]>{contents = "4"} =
<CFString 0xcc822fe0 [0x1e3bca0]>{contents =[COLOR="Red"] "$3.00 - Above"[/COLOR]}
[B][COLOR="red"]1[/COLOR][/B] : <CFString 0xcc8ceff0 [0x1e3bca0]>{contents = "2"} =
<CFString 0xcc8d0fe0 [0x1e3bca0]>{contents =[COLOR="red"] "$1.00 - $1.99"[/COLOR]}
[B][COLOR="red"]4 [/COLOR][/B]: <CFString 0xcc924ff0 [0x1e3bca0]>{contents = "1"} =
<CFString 0xcc926fe0 [0x1e3bca0]>{contents = [COLOR="red"]"Below - $0.99"[/COLOR]}
[B][COLOR="red"]7 [/COLOR][/B]: <CFString 0xcc86eff0 [0x1e3bca0]>{contents = "3"} =
<CFString 0xcc870fe0 [0x1e3bca0]>{contents =[COLOR="red"] "$2.00 - $2.99[/COLOR]"}
)}