You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Workarounds for issue johnezang#19 (the clang stuff) and issue johnezang#23. For issue johnezang#23, the code in the collection classes +load was removed and placed in a function with the __attribute__ ((constructor)) attribute. This is to work around an apparent bug when building JSONKit as a static library for iOS targets. @ohhorob also opened a bug with apple- # 9461567.
Copy file name to clipboardExpand all lines: JSONKit.m
+33-26Lines changed: 33 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -609,6 +609,31 @@ - (void)releaseState;
609
609
// classes receive the mutating methods, but this is handled by having those methods throw an exception when the ivar bit is set to immutable.
610
610
// We adopt the same strategy here. It's both cleaner and gets rid of the method swizzling hackery used in JSONKit v1.4.
611
611
612
+
613
+
// This is a workaround for issue #23 https://github.com/johnezang/JSONKit/pull/23
614
+
// Basically, there seem to be a problem with using +load in static libraries on iOS. However, __attribute__ ((constructor)) does work correctly.
615
+
// Since we do not require anything "special" that +load provides, and we can accomplish the same thing using __attribute__ ((constructor)), the +load logic was moved here.
NSAutoreleasePool *pool = [[NSAutoreleasePoolalloc] init]; // Though technically not required, the run time environment at +load time may be less than ideal.
NSAutoreleasePool *pool = [[NSAutoreleasePoolalloc] init]; // Though technically not required, the run time environment at +load time may be less than ideal.
NSAutoreleasePool *pool = [[NSAutoreleasePoolalloc] init]; // Though technically not required, the run time environment at +load time may be less than ideal.
0 commit comments