What does this Objective-C dictionary code do?

前端 未结 2 913
深忆病人
深忆病人 2021-01-28 09:21

.h

@property (nonatomic, strong) NSMutableDictionary * products;  //not synthesized in .m

.m

- (void)productsRequest:(SKProduct         


        
2条回答
  •  悲&欢浪女
    2021-01-28 10:11

    It's not IAPProduct *product= NSMutableDictionary[NSArray.productIdentifier];

    The type of skProduct is SKProduct, not NSArray. The fast enumeration for (SKProduct * skProduct in skProducts) loops through all elements in skProducts as SKProduct.

    It's (to some extent) like using a loop with a counter doing:

    //for (SKProduct * skProduct in skProducts)
    for (int i=0; i

提交回复
热议问题