+2004-10-30 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * SaxObjectDecoder.m: provide fix for discovering mutable array on
+ Apple/CoreFoundation - this is rather disturbing, but Apple really
+ broke the concept of mutability for NSArray/NSDictionary. (v4.3.42)
+
2004-09-22 Marcus Mueller <znek@mulle-kybernetik.com>
* SaxObjC.xcode: minor fixes
#include "SaxObjectModel.h"
#include "common.h"
+#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY || \
+ APPLE_FOUNDATION_LIBRARY
+bool _CFArrayIsMutable(CFArrayRef dict);
+#endif
+
static NSDictionary *mapDictsToObjects(NSDictionary *_dict, Class clazz) {
NSMutableDictionary *md;
NSEnumerator *e;
static BOOL doDebug = NO;
static NSArray *searchPathes = nil;
+#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY || \
+ APPLE_FOUNDATION_LIBRARY
+static Class NSCFArrayClass = Nil;
+
++ (void)initialize {
+ static BOOL isInitialized = NO;
+
+ if (isInitialized) return;
+ isInitialized = YES;
+ NSCFArrayClass = NSClassFromString(@"NSCFArray");
+#endif
+}
+
+ (NSArray *)saxMappingSearchPathes {
if (searchPathes == nil) {
NSMutableArray *ma;
[_object takeValue:[NSArray arrayWithObject:_value] forKey:_key];
}
else {
+#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY || \
+ APPLE_FOUNDATION_LIBRARY
+ if ([v isKindOfClass:NSCFArrayClass] &&
+ _CFArrayIsMutable((CFArrayRef)v))
+#else
if ([v respondsToSelector:@selector(addObject:)])
+#endif
/* the value is mutable */
[v addObject:_value];
else {