简体   繁体   中英

Calling “shuffledArray” method Crashes App

I'm trying to use the new shuffledArray method to shuffle the elements in an NSMutableArray . I have the Array declared:

@property (strong, nonatomic) NSMutableArray *mArray;

Then I call the method

mArray = [[self.mArray shuffledArray] mutableCopy];

But I'm getting the exception:

-[__NSArrayM shuffledArray]: unrecognized selector sent to instance 0x1c4451340

I've imported the GameplayKit Framework as well, and my app's target is iOS 10.0 so I'm not sure what's wrong.

You need to link the framework to your project as well, not just import it.

链接的框架和库xcode

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM