sphero-inc / Sphero-iOS-SDK

🚫 DEPRECATED: Sphero™ is the amazing robotic ball ( sphero.com ) created by Orbotix, this is the repository for the iOS SDK for Sphero™. Visit dev site for more information:
http://sdk.sphero.com
225 stars 81 forks source link

[Suggestion] Add deprecated compiler attribute to deprecated method #16

Closed sodastsai closed 9 years ago

sodastsai commented 9 years ago

I found that inn RKConfigureCollisionDetectionCommand class, this method

- (id) initForMethod:(RKCollisionDetectionMethod) method
          xThreshold:(uint8_t) theXThreshold
          yThreshold:(uint8_t) theYThreshold
     xSpeedThreshold:(uint8_t) theXSpeedThreshold
     ySpeedThreshold:(uint8_t) theYSpeedThreshold
    postTimeDeadZone:(NSTimeInterval) deadZone;

has been marked as deprecated in the document comment.

I think it's better to add compiler attribute to make the clang compiler notifies developers that this is a deprecated method. clang attributes ref

- (id) initForMethod:(RKCollisionDetectionMethod) method
          xThreshold:(uint8_t) theXThreshold
          yThreshold:(uint8_t) theYThreshold
     xSpeedThreshold:(uint8_t) theXSpeedThreshold
     ySpeedThreshold:(uint8_t) theYSpeedThreshold
    postTimeDeadZone:(NSTimeInterval) deadZone __attribute__((deprecated("Use -[RKConfigureCollisionDetectionCommand initForMethod:xThreshold:xSpeedThreshold:yThreshold:ySpeedThreshold:postTimeDeadZone:] instead.")))
zenelk commented 9 years ago

Tracked as SDK-662

zenelk commented 9 years ago

Included in Beta 3