objective c - Support newer features in older versions of OS X SDK -


I'm learning more about coco, purpose-c, and xcode by contributing to the open-source project (); The project basically supports OS X 10.5.

In my hurry it seems that I have elements of SDK ( NSJSONSerialization and @autoreleasepool compiler instructions) which are not supported by old SDK

  • NSJSANASialisation - I think now, I am trying to determine what I can do to restore support for 10.5

    I can

  • @autoreleasepool {} -?
  • @properties - can add @synthesize and IVARs

    question: < / p>

    • If there is a way to use the new SDK elements then the OS supports (compiler's instruction?) if necessary? If so, is it better to reapply the functionality in this version-specific methods (like getJSONlegacy , getJSON )?
    • Is it better to have the original project as a separate branch (can it be extended)?

      Various attributes include different OS components, which defines the use of a feature How can it be done in many OS X versions? Here's my rough classification:

      • The functionality is fully provided by some framework, for example, NSJSONSerialization is available in Mac OS X 10.7+ You can use the same solution for all OS versions or check at runtime if some functionality is available. For example,

          if (Answer the response to Tsechel: @selector (setexcepts touchAventus :)) [set up attendant events: yes];   

        More information about multiple SDK support can be found.

      • The functionality is fully provided by the compiler, for example, @autoreleasepool , literals.

      • The functionality is provided by the compiler and runtime. For example, see the default @property synthesis for more information.

      • The functionality depends on SDK against which an application is connected. It is more about behavior change, the previous compatibility of such a mechanism is described in the section.

        And now there is a facility available on your question, there is a mechanism to check in runtime, many times the gives feedback: Ticetilator: Job can I recommend expose a single method that works on all OS versions. And there is difference between OS versions only within this method. For example,

          - (NSString *) base64EncodingForData: (NSDT *) data {Ensempeter Asset (Data); If (Answer to the data: TSEseller: @Selector (base64 encoded stringwid option:)) Returns [Data base 64 encoded stringwith option: NSDTabab 64 encoding 776 lineline];} Else {// Manual encoding using & lt; security / SecEncodeTransform.h & gt; and kSecBase64Encoding}}   

        You can create 1.1 maintenance branches, do all the work in the master, and maintain the maintenance branch only in bug fixes So you can maintain 1.1.1 and ma from the maintenance branch. It is a practical approach but you can not support the Mac OS X 10.5 indefinitely, so you need to decide which IPv4 version you will leave 10.5 support.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -