logo
  • 教程列表
  • SO官方文檔
  • NSDictionary
    • 建立
    • 使用文字建立
    • NSDictionary 到 NSArray
    • 使用 dictionaryWithObjectsAndKeys 建立
    • NSDictionary 到 NSData
    • 使用 plist 建立
    • NSDictionary 到 JSON
    • 在 NSDictionary 中設定值
    • 基於塊的列舉
    • 從 NSDictionary 獲取價值
    • 快速列舉
    • 檢查 NSDictionary 是否已有金鑰
  1. StackOverflow 文件
  2. Objective-C Language 教程
  3. NSDictionary
  4. NSDictionary 到 NSArray

NSDictionary 到 NSArray

Created: November-22, 2018

NSDictionary *myDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"value1", @"key1", @"value2", @"key2", nil];  
NSArray *copiedArray = myDictionary.copy; 

獲取金鑰:

NSArray *keys = [myDictionary allKeys];

獲取價值:

NSArray *values = [myDictionary allValues];
  • 使用 dictionaryWithObjectsAndKeys 建立
  • 使用文字建立

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明