41 BOOL _awakenCustomResources;
46 - (id)initWithContentsOfURL:(
CPURL)aURL
57 _awakenCustomResources = YES;
63 - (id)initWithContentsOfURL:(
CPURL)aURL loadDelegate:(
id)aLoadDelegate
71 _awakenCustomResources = YES;
73 _loadDelegate = aLoadDelegate;
81 if (![aName hasSuffix:
@".cib"])
93 - (id)initWithCibNamed:(
CPString)aName bundle:(
CPBundle)aBundle loadDelegate:(
id)aLoadDelegate
95 if (![aName hasSuffix:
@".cib"])
107 - (void)_setAwakenCustomResources:(BOOL)shouldAwakenCustomResources
109 _awakenCustomResources = shouldAwakenCustomResources;
112 - (BOOL)_awakenCustomResources
114 return _awakenCustomResources;
117 - (BOOL)instantiateCibWithExternalNameTable:(
CPDictionary)anExternalNameTable
119 var bundle = _bundle,
122 if (!bundle && owner)
125 var unarchiver = [[_CPCibKeyedUnarchiver alloc] initForReadingWithData:_data bundle:bundle awakenCustomResources:_awakenCustomResources],
126 replacementClasses = [anExternalNameTable
objectForKey:CPCibReplacementClasses];
128 if (replacementClasses)
131 keyEnumerator = [replacementClasses keyEnumerator];
133 while ((key = [keyEnumerator nextObject]) !== nil)
134 [unarchiver setClass:[replacementClasses objectForKey:key] forClassName:key];
137 [unarchiver setExternalObjectsForProxyIdentifiers:[anExternalNameTable
objectForKey:CPCibExternalObjects]];
139 var objectData = [unarchiver decodeObjectForKey:CPCibObjectDataKey];
141 if (!objectData || ![objectData isKindOfClass:[_CPCibObjectData
class]])
144 var topLevelObjects = [anExternalNameTable
objectForKey:CPCibTopLevelObjects];
146 [objectData instantiateWithOwner:owner topLevelObjects:topLevelObjects];
147 [objectData establishConnectionsWithOwner:owner topLevelObjects:topLevelObjects];
148 [objectData awakeWithOwner:owner topLevelObjects:topLevelObjects];
151 [objectData displayVisibleWindows];
156 - (BOOL)instantiateCibWithOwner:(
id)anOwner topLevelObjects:(
CPArray)topLevelObjects
176 if ([_loadDelegate respondsToSelector:
@selector(cibDidFailToLoad:)])
177 [_loadDelegate cibDidFailToLoad:self];
184 if ([_loadDelegate respondsToSelector:
@selector(cibDidFinishLoading:)])
185 [_loadDelegate cibDidFinishLoading:self];