NSMutableArray of ClLocationCoordinate2D

前端 未结 5 930
遇见更好的自我
遇见更好的自我 2020-12-16 11:27

I\'m trying to create then retrieve an array of CLLocationCoordinate2D objects, but for some reason the array is always empty.

I have:

NSMutableArray         


        
5条回答
  •  既然无缘
    2020-12-16 12:22

    As SB said, make sure your array is allocated and initialized.

    You’ll also probably want to use NSValue wrapping as in your second code snippet. Then decoding is as simple as:

    NSValue *wrappedCoordinates = [currentlyDisplayedTowers lastObject]; // or whatever object you wish to grab
    CLLocationCoordinate2D coordinates;
    [wrappedCoordinates getValue:&coordinates];
    

提交回复
热议问题