PHCollection localizedTitle crash in iOS 14.2.1

Code Block language
PHFetchResult *topLevelUserCollections = [PHCollectionList fetchTopLevelUserCollectionsWithOptions:nil];
  for (NSInteger i = 0; i < topLevelUserCollections.count; i++) {
    PHCollection *collection = topLevelUserCollections[i];
    id value = collection.localizedTitle;
    NSLog(@"%@", value);
  }


this value is bad address

Replies

this (NSString *) value = 0xa08fc90a9a686dc6 , not a string
I found reason, my category NSString+Ext, swizzle rangeOfString:, but my method is
Code Block
+ (void)initialize
, I replace it with
Code Block
+ (void)load
, it word.
  • Do you know the specific reason?

Add a Comment