Author: mlytwyn Date: Tue Dec 2 21:36:00 2014 New Revision: 38224 URL: http://svn.gna.org/viewcvs/gnustep?rev=38224&view=rev Log: Fix object ID parsing in XIB loading due to Apple moving to string ID represenatation
Modified: libs/gui/branches/gnustep_testplant_branch/Headers/Additions/GNUstepGUI/GSXibLoading.h libs/gui/branches/gnustep_testplant_branch/Source/GSXibLoader.m Modified: libs/gui/branches/gnustep_testplant_branch/Headers/Additions/GNUstepGUI/GSXibLoading.h URL: http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Headers/Additions/GNUstepGUI/GSXibLoading.h?rev=38224&r1=38223&r2=38224&view=diff ============================================================================== --- libs/gui/branches/gnustep_testplant_branch/Headers/Additions/GNUstepGUI/GSXibLoading.h (original) +++ libs/gui/branches/gnustep_testplant_branch/Headers/Additions/GNUstepGUI/GSXibLoading.h Tue Dec 2 21:36:00 2014 @@ -121,14 +121,14 @@ @interface IBObjectRecord: NSObject { - int objectID; + id objectID; id object; id children; id parent; } - (id) object; - (id) parent; -- (NSInteger) objectID; +- (id) objectID; @end @interface IBMutableOrderedSet: NSObject @@ -136,7 +136,7 @@ NSArray *orderedObjects; } - (NSArray *)orderedObjects; -- (id) objectWithObjectID: (NSInteger)objID; +- (id) objectWithObjectID: (id)objID; @end @interface IBObjectContainer: NSObject <NSCoding> Modified: libs/gui/branches/gnustep_testplant_branch/Source/GSXibLoader.m URL: http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/GSXibLoader.m?rev=38224&r1=38223&r2=38224&view=diff ============================================================================== --- libs/gui/branches/gnustep_testplant_branch/Source/GSXibLoader.m (original) +++ libs/gui/branches/gnustep_testplant_branch/Source/GSXibLoader.m Tue Dec 2 21:36:00 2014 @@ -564,23 +564,12 @@ if ([coder containsValueForKey: @"objectID"]) { // PRE-4.6 XIBs.... - objectID = [coder decodeIntForKey: @"objectID"]; + objectID = [coder decodeObjectForKey: @"objectID"]; } else if ([coder containsValueForKey: @"id"]) { // 4.6+ XIBs.... - NSString *string = [coder decodeObjectForKey: @"id"]; - if (string && [string isKindOfClass:[NSString class]] && [string length]) - { - objectID = [string intValue]; - } - else - { - NSString *format = [NSString stringWithFormat:@"%s:class: %@ - object ID is missing or zero!", - __PRETTY_FUNCTION__, NSStringFromClass([self class])]; - [NSException raise: NSInvalidArgumentException - format: format]; - } + objectID = [coder decodeObjectForKey: @"id"]; } else { @@ -632,7 +621,7 @@ return parent; } -- (NSInteger) objectID +- (id) objectID { return objectID; } @@ -678,7 +667,7 @@ return orderedObjects; } -- (id) objectWithObjectID: (NSInteger)objID +- (id) objectWithObjectID: (id)objID { NSEnumerator *en; IBObjectRecord *obj; @@ -686,7 +675,7 @@ en = [orderedObjects objectEnumerator]; while ((obj = [en nextObject]) != nil) { - if ([obj objectID] == objID) + if ([[obj objectID] isEqual:objID]) { return [obj object]; } @@ -760,7 +749,7 @@ return [[objectRecords orderedObjects] objectEnumerator]; } -- (NSDictionary*) propertiesForObjectID: (int)objectID +- (NSDictionary*) propertiesForObjectID: (id)objectID { NSEnumerator *en; NSString *idString; @@ -768,7 +757,7 @@ NSMutableDictionary *properties; int idLength; - idString = [NSString stringWithFormat: @"%d.", objectID]; + idString = [NSString stringWithFormat: @"%@.", objectID]; idLength = [idString length]; properties = [[NSMutableDictionary alloc] init]; en = [flattenedProperties keyEnumerator]; _______________________________________________ Gnustep-cvs mailing list Gnustep-cvs@gna.org https://mail.gna.org/listinfo/gnustep-cvs