How can I get the first element in an NSDictionary?

There is no “first” element in an NSDictionary; its members have no guaranteed order. If you just want one object from a dictionary, but don’t care which key it’s associated with, you can do:

id val = nil;
NSArray *values = [yourDict allValues];

if ([values count] != 0)
    val = [values objectAtIndex:0];

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)