<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFBitVectorSetCount(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFBitVectorSetCount"
  },
  "title" : "CFBitVectorSetCount(_:_:)"
}
-->

# CFBitVectorSetCount(_:_:)

Changes the size of a mutable bit vector.

```
func CFBitVectorSetCount(_ bv: CFMutableBitVector!, _ count: CFIndex)
```

## Parameters

`bv`

The bit vector to modify.

`count`

The new size for `bv`. If `count` is greater than the current size of `bv`, the additional bit values are set to `0`.

## Discussion

If `bv` was created with a fixed capacity, you cannot increase its size beyond that capacity.

## See Also

[`CFBitVectorCreateMutable(_:_:)`](/documentation/CoreFoundation/CFBitVectorCreateMutable(_:_:))

Creates a mutable bit vector.

[`CFBitVectorCreateMutableCopy(_:_:_:)`](/documentation/CoreFoundation/CFBitVectorCreateMutableCopy(_:_:_:))

Creates a new mutable bit vector from a pre-existing bit vector.

[`CFBitVectorGetCount(_:)`](/documentation/CoreFoundation/CFBitVectorGetCount(_:))

Returns the number of bit values in a bit vector.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)