How to store CGRect values in NSMutableArray?

后端 未结 4 987
野性不改
野性不改 2021-01-30 01:20

How would I store CGRect objects in a NSMutableArray, and then later retrieve them?

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 01:57

    We store the CGRect,CGPoint,CMTime objects in a NSMutableArray,

    [arrayName addObject:[NSValue valueWithCGPoint:MyCGPoint]]

    [arrayName addObject:[NSValue valueWithCGRect:MyCGRect]]

    [arrayName addObject:[NSValue valueWithCMTime:MyCMTime]]

    [arrayName addObject:[NSValue valueWithCMTimeRange:MyCMTimeRange]]

提交回复
热议问题