如何判断NSMutableDictionary是否有某个key

2025-05-18 03:03:22
推荐回答(1个)
回答1:

keyEnumeratorReturns an enumerator object that lets you access each key in the receiver.- (NSEnumerator *)keyEnumeratorReturn ValueAn enumerator object that lets you access each key in the receiver.DiscussionThe following code fragment illustrates how you might use this method.NSEnumerator *enumerator = [myDictionary keyEnumerator];id key;while ((key = [enumerator nextObject])) { /* code that uses the returned key */}