本文整理汇总了C++中NSString::retain方法的典型用法代码示例。如果您正苦于以下问题:C++ NSString::retain方法的具体用法?C++ NSString::retain怎么用?C++ NSString::retain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NSString
的用法示例。
在下文中一共展示了NSString::retain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JSValueToNSString
EJ_BIND_SET( EJBindingImage, src, ctx, value) {
// If the texture is still loading, do nothing to avoid confusion
// This will break some edge cases; FIXME
if( loading ) { return; }
NSString * newPath = JSValueToNSString( ctx, value );
// Release the old path and texture?
if( path ) {
// Same as the old path? Nothing to do here
if( path->isEqual(newPath) ) { return; }
path->release();
path = NULL;
texture->release();
texture = NULL;
}
if( newPath->length() ) {
newPath->retain();
path = newPath;
beginLoad();
}
}
示例2: textureId
EJTexture::EJTexture(int widthp, int heightp, GLenum formatp) : textureId(0), width(0), height(0), realWidth(0), realHeight(0) {
// Create an empty texture
contentScale = 1;
NSString* empty = NSStringMake("[Empty]");
empty->retain();
fullPath = empty;
setWidthAndHeight(widthp, heightp);
createTextureWithPixels(NULL, formatp);
}