mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 06:00:48 +00:00
Skip initial view controller if it doesn't exist
This commit is contained in:
parent
43feefce68
commit
7850f8e61b
2 changed files with 77 additions and 58 deletions
|
@ -612,10 +612,14 @@
|
|||
if ([docNodes count] > 0)
|
||||
{
|
||||
NSXMLElement *docNode = [docNodes objectAtIndex: 0];
|
||||
|
||||
if (docNode != nil)
|
||||
{
|
||||
NSArray *array = [docNode nodesForXPath: @"//scene" error: NULL];
|
||||
NSArray *firstResponderIdNodes = [docNode nodesForXPath: @"//objects/customObject[@sceneMemberID =\"firstResponder\"]/@id"
|
||||
error: NULL];
|
||||
NSString *firstResponderId = @"-1";
|
||||
NSXMLNode *initialViewControllerNode = [docNode attributeForName: @"initialViewController"];
|
||||
|
||||
if([firstResponderIdNodes count] > 0)
|
||||
{
|
||||
|
@ -623,7 +627,11 @@
|
|||
}
|
||||
|
||||
// Set initial view controller...
|
||||
if (initialViewControllerNode != nil)
|
||||
{
|
||||
ASSIGN(_initialViewControllerId, [[docNode attributeForName: @"initialViewController"] stringValue]);
|
||||
}
|
||||
|
||||
FOR_IN(NSXMLElement*, e, array)
|
||||
{
|
||||
NSXMLElement *doc = [[NSXMLElement alloc] initWithName: @"document"];
|
||||
|
@ -675,6 +683,12 @@
|
|||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"No document element found in storyboard file"];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"Document node returned nil"];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) isProcessedDocument: (NSXMLDocument *)xmlIn
|
||||
|
|
|
@ -164,8 +164,13 @@ static NSStoryboard *__mainStoryboard = nil;
|
|||
|
||||
- (id) instantiateControllerWithIdentifier: (NSStoryboardSceneIdentifier)identifier
|
||||
{
|
||||
if (identifier != nil)
|
||||
{
|
||||
return [self instantiateControllerWithIdentifier: identifier
|
||||
creator: nil];
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (id) instantiateControllerWithIdentifier: (NSStoryboardSceneIdentifier)identifier
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue