Two questions about cocoa programming...
Two questions about cocoa programming...
- Subject: Two questions about cocoa programming...
- From: Leopard x86 <email@hidden>
- Date: Sun, 28 Sep 2008 16:44:00 +0000
Hi everyone. In the recent development, I need to solve the following
two issues:
1. How to distinguish the difference about the inline children count
of the XML Node?
here is my code:
xmlDoc = [[NSXMLDocument alloc] initWithXMLString:[NSString
stringWithContentsOfFile:_filePath]
options:NSXMLDocumentTidyXML
error:&err];
NSXMLElement* _rootNode = (NSXMLElement*)[xmlDoc rootElement];
print: [_rootNode childCount];
Here is twe snippets of xml files:
#1 <?xml version="1.0" encoding="UTF-8"?>
<Descriptor
something = "something">
yetAnotherThing
<floor>
</floor >
<Man>
</Man >
</Descriptor>
This file outputs answer: 3
//////////////////////////////////////////////////////////////////////////////////
Another similar file output:
#2 <?xml version="1.0" encoding="UTF-8"?>
< Descriptor
something = "something">
< floor >
</floor >
< Man >
</Man >
</Descriptor>
This file outputs answer: 2
Is there any method to detect the existence of the "yetAnotherThing"
node?
More concretely, you can nest the node under the parent node with <>
label or not, how to detect the child without being nested by the <>
label?
Sorry for my English, I hope I have explained the question clearly. :-)
2. Using openPanel function: how can we memorize the most recent
opened directory?
As the question says, we often the open panel directive to
open file, is there some method to guarantee that we can be the same
location which is opened last time?
Thank you very much for any help. Good luck.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden