创建和使用范围(Creating and Using Ranges)CFString in Core Foundation
2013-09-02 11:47
471 查看
许多核心基础使用范围(Ranges),一个CFRange类型的结构参数,范围是一个线性段标准;它有一个初始的位置和一个长度。要创建和初始化这种结构你可以使用方便CFRangMake函数。
下面的代码片段获取数组中匹配第一个节点的子节点数量:
CFRange aRange = CFRangeMake(1,CFArrayGetCount(array)-1);
//从第一个开始,剩下的范围长度是count-1
const void *aValue = CFArrayGetValueAtIndex(array,0);
CFIndex numVals = CFArrayGetCountOfValue(array,aRange,aValue);
下面的代码片段获取数组中匹配第一个节点的子节点数量:
CFRange aRange = CFRangeMake(1,CFArrayGetCount(array)-1);
//从第一个开始,剩下的范围长度是count-1
const void *aValue = CFArrayGetValueAtIndex(array,0);
CFIndex numVals = CFArrayGetCountOfValue(array,aRange,aValue);
相关文章推荐
- custom control的使用方法(Creating and Using custom controls in VC++)
- VS2010使用介绍创建可重用代码(一)---Creating and Using a Dynamic Link Library (C++)
- 使用vs2010创建可重用代码(三)Creating and Using a Managed Assembly (C++)
- VS2010使用介绍创建可重用代码(一)---Creating and Using a Dynamic Link Library (C++)
- (转载)攻略:创建和使用动态链接库Walkthrough: Creating and Using a Static Library
- 使用vs2010创建可重用代码(二)Creating and Using a Static Library (C++)
- 在网页中使用Winform控件,并调整其大小(using Winform control in ASP.NET and adjust its size)
- Automating Excel 2007 and creating charts using C++ MFC application in Visual Studio 2008
- Using Styles and Themes in Android(在Android中使用主题和样式)
- using web services core framework and CFNetwork to access remote soap service
- POST a string and an image in one request using HttpClient
- Dynamically creating bound and template columns in GridView using ASP.Net
- react 使用 ref 报错 ,[eslint] Using string literals in ref attributes is deprecated. (react/no-string-refs)
- 使用 PVRTC 压缩格式创建纹理(Creating textures in the PVRTC compression format)
- Creating and Using Temporary Tables in Oracle
- Creating and Using Your Own Delegates in Objective-C
- @RequestParam注解使用:Name for argument type [java.lang.String] not available, and parameter name information not found in class file either.
- SCSF - Part 8 Creating and Using Services in the CAB
- Creating and Using custom controlsin VC++
- Sensor Fusion-based Exploration in Home Environments using Information, Driving and Localization Gains(基于传感器融合的使用信息、驾驶和定位增益在家庭环境中的探索)