0

I have created a custom ios framework, which I intend to distribute without source. Previously it was supposed to support devices with min iOS 5. But now it is decided to enable support from iOS 4.3

Now I face 2 primary issues.

  1. My framework is ARC enabled. Can developers use the framework in ARC enabled / ARC disabled projects? How to use.

  2. I use NSJSON As this is only available since iOS 5. I think I have to use something like JSON kit.

  3. base sdk usage. Since I use ARC, if I decide to use baseSDK as 4.3, xCode will attach libarc along with my framework.

Please advice.

bllakjakk
  • 5,045
  • 1
  • 18
  • 28

2 Answers2

1

You won't have to worry about ARC. This is an implementation detail of your library. A client may use ARC or not.

Base SDK shall always be the most recent.

Deployment target is the lowest version you support: iOS 4.3

Regarding your JSON library, at any rate use NSJSONSerialization when available. You might check the version or better the class if it is available and then "branch" to the appropriate parser:

Class NSJSONSerializationClass = NSClassFromString(@"NSJSONSerialization");
NSError* error;
id jsonObject;
if (NSJSONSerializationClass == nil) {
    // No NSJSONSerialization class, use custom JSON parser:
    jsonObject = [MyJSONParser parseJSONData:data options:0 error:&error]; 
}
else {
    jsonObject = [NSJSONSerialization JSONObjectWithData:data options:0 error:error];
}
CouchDeveloper
  • 18,174
  • 3
  • 45
  • 67
0

Arc is supported in iOS 4.3 Arc Support 4.3 regarding JSON, it might be best to use JSONKit as opposed to NSJSON for backwards compatibility.

Community
  • 1
  • 1
sbarow
  • 2,759
  • 1
  • 22
  • 37
  • How about developers who may want to include the framework in non-arc project ? Will it be a problem ? Remember the framework does not include the source in release. – bllakjakk Aug 15 '13 at 09:27