Post

Replies

Boosts

Views

Activity

Reply to Why Xcode 12.5 errs when using Class as a key in NSDictionary?
         if ( !animationOperation.isCanceled ) {           if ( !period.startValue ) {             [period setStartValueFromObject:animationOperation.boundObject propertyGetter:animationOperation.boundGetter];           }           Class valueClass = period.valueClass;           CGFloat progress = timingFunction(currentTime - startTime, duration);           CPTDictionary *parameters = @{             CPTAnimationOperationKey: animationOperation,             CPTAnimationValueKey: [period tweenedValueForProgress:progress],             CPTAnimationValueClassKey: valueClass ? valueClass : [NSNull null], /* this line won't compile in xcode 12.5 the error message is: Incompatible operand types ('Class' and 'NSNull * _Nonnull')*/             CPTAnimationStartedKey: @(started),             CPTAnimationFinishedKey: @(currentTime = endTime)           };           // Used -performSelectorOnMainThread:... instead of GCD to ensure the animation continues to run in all run loop common modes.           [self performSelectorOnMainThread:@selector(updateOnMainThreadWithParameters:)                       withObject:parameters                     waitUntilDone:NO                         modes:runModes];           if ( currentTime = endTime ) {             [expiredOperations addObject:animationOperation];           }         } Upgraded today to Xcode 12.5, existing project build failed. The code snippet source is from CorePlot: https://github.com/core-plot/core-plot/blob/master/framework/Source/CPTAnimation.m line 339 What should i do to avoid from this fail? (without changing the source code) Thank you!
Apr ’21