NSString *Str=[yourDic valueForKey:@"ABC"];
ios: retrieve values from nsdictonary [closed]
-
20-06-2023 - |
문제
I get values as shown below.
How can I get particular values of ABC, NI, NTI, SRNI and TTT?
(
{
ABC = A;
NI = 5;
NTI = I;
SRNI = 12R00109;
TTT = Pqr;
}
)
해결책
다른 팁
NSDictionary *dict = @{@"ABC": @"A",
@"NI" : @5,
@"NTI": @"I"};
NSLog(@"ABC = %@, NI = %@, NTI = %@" , dict[@"ABC"], dict[@"NI"], dict[@"NTI"]);
Now you have an Array and dictionary so you can retrieve like this
NSString *strABC = [[yourArray objectatindex:0] valueforkey:@"ABC"];
NSString *strNI = [[yourArray objectatindex:0] valueforkey:@"NI"];
제휴하지 않습니다 StackOverflow