我正在尝试创建一个应该包含solo标签的XML字符串(即.标签没有单独的结束标签)我能够创建正常的xml标签,如
<tagname attribute=attributevalue></tagname>
Run Code Online (Sandbox Code Playgroud)
使用代码
NSXMLElement *childElement=[[NSXMLElement alloc] initWithName:childName];
childElement.stringValue=childValue;
[childElement addAttribute:[NSXMLNode attributeWithName:attributeName stringValue:attributeValue]];
[self.currentNode addChild:[childElement copy]];
Run Code Online (Sandbox Code Playgroud)
但我需要这样的
<tagname attributename=attributevalue />
Run Code Online (Sandbox Code Playgroud) 我正在使用 Objective-c 在 Mac 中编写命令行应用程序
在应用程序启动时,我想检查同一应用程序的另一个实例是否已经在运行。如果是,那么我应该等待它完成或退出当前实例或退出其他实例等。
有什么办法可以做到这一点吗?
macos objective-c command-line-tool osx-snow-leopard osx-lion