In a self-complementing weighted code, the 9's complement is obtained by inverting all bits. For this property to hold in a 4-bit BCD code, the sum of the weights must be 9. This ensures that the weighted sum of inverted bits equals 9 minus the original digit.