本文整理汇总了C++中NSString::release方法的典型用法代码示例。如果您正苦于以下问题:C++ NSString::release方法的具体用法?C++ NSString::release怎么用?C++ NSString::release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NSString
的用法示例。
在下文中一共展示了NSString::release方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: plist_characters
void plist_characters(void *ctx, const xmlChar *ch, int len)
{
CCDictMaker * pMaker = (CCDictMaker*)(ctx);
if (pMaker->m_tState == SAX_NONE)
{
return;
}
NSString *pText = new NSString();
pText->m_sString = std::string((char*)ch,0,len);
switch(pMaker->m_tState)
{
case SAX_KEY:
pMaker->m_sCurKey = pText->m_sString;
break;
case SAX_INT:
case SAX_REAL:
case SAX_STRING:
{
NSAssert(!pMaker->m_sCurKey.empty(), "not found key : <integet/real>");
pMaker->m_pCurDict->setObject(pText, pMaker->m_sCurKey);
break;
}
}
pText->release();
}
示例2: onEnter
//------------------------------------------------------------------
//
// SchedulerUpdate
//
//------------------------------------------------------------------
void SchedulerUpdate::onEnter()
{
SchedulerTestLayer::onEnter();
TestNode* d = new TestNode();
NSString* pStr = new NSString("---");
d->initWithString(pStr, 50);
pStr->release();
addChild(d);
d->release();
TestNode* b = new TestNode();
pStr = new NSString("3rd");
b->initWithString(pStr, 0);
pStr->release();
addChild(b);
b->release();
TestNode* a = new TestNode();
pStr = new NSString("1st");
a->initWithString(pStr, -10);
pStr->release();
addChild(a);
a->release();
TestNode* c = new TestNode();
pStr = new NSString("4th");
c->initWithString(pStr, 10);
pStr->release();
addChild(c);
c->release();
TestNode* e = new TestNode();
pStr = new NSString("5th");
e->initWithString(pStr, 20);
pStr->release();
addChild(e);
e->release();
TestNode* f = new TestNode();
pStr = new NSString("2nd");
f->initWithString(pStr, -5);
pStr->release();
addChild(f);
f->release();
schedule(schedule_selector(SchedulerUpdate::removeUpdates), 4.0f);
}