开发者

iPhone: can i use NSString search in NSArray

开发者 https://www.devze.com 2023-02-01 04:47 出处:网络
can i use like this r not for (NSString *string in userInfo){ lblUserName.text = (NSString *) [userInfo objectForKey:@\"name\"];

can i use like this r not

for (NSString *string in userInfo){


        lblUserName.text = (NSString *) [userInfo objectForKey:@"name"];

        lblLocation.text = (NSString *) [userInfo objectForKey:@"location"];

        lblDescription.text =(NSString *) [userInfo objectForKey:@"description"];


    NSLog(@"User profileData Received:开发者_StackOverflow中文版 %@", userInfo);

    }

here userInfo = NSArray (this is delegate i can change )

lblUserName = label name

ObectForKey is using for searching NSString

thank you, is this Right r wrong one

if not how i have to work out


NSArray are not key based but index based. Use NSDictionary instead or use index to retrieve items.

and I don't understand what is the loop for, you don't even use the string var in it ???

0

精彩评论

暂无评论...
验证码 换一张
取 消