1

Google Drive SDK requires modification to run under Xcode 6 beta, primarily because of the following changes...

NSGregorianCalendarIdentifier is deprecated in iOS 8 in favour of NSCalendarIdentifierGregorian,

and

NSUndefinedDateComponent is deprecated in iOS 8 in favour of NSDateComponentUndefined,

and

all references to NSCalendarUnits have changed so that the unique identifier of each key is moved from the front to the end. For example...

NSMonthCalendarUnit is deprecated in iOS 8 in favour of NSCalendarUnitMonth.

While I applaud these sensible changes, I had to run through a couple of classes to change the deprecated keys. This in itself is a five minute fix, and does not concern me at all.

My problem: When I return to Xcode 5.1.1 to continue building "next releases", I must change these back to the deprecated keys.

Rather than duplicate entire Xcode projects, is there a more frugal method that will manipulate the GTLDateTime header and implementation files to manage both scenarios?

andrewbuilder
  • 3,629
  • 2
  • 24
  • 46

1 Answers1

0

You can do this with compiler directives.

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000

// do Xcode 6 stuff

#else

// do Xcode 5 and earlier stuff

#endif

This will conditionally compile the code so that the new compiler won't complain about the deprecations and the old one won't complain about nonexistent symbols.

More info here

Community
  • 1
  • 1
Dima
  • 23,484
  • 6
  • 56
  • 83