• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Two questions about cocoa programming...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Two questions about cocoa programming...
      • From: Graham Cox <email@hidden>
    • Re: Two questions about cocoa programming...
      • From: Chris Hanson <email@hidden>
  • Prev by Date: Re: Collections can be simple Attributes in Core Data
  • Next by Date: Load launchd job immediately, without restart - how?
  • Previous by thread: [ann] MacCode code repository Release 1
  • Next by thread: Re: Two questions about cocoa programming...
  • Index(es):
    • Date
    • Thread