Assertion when adding TWTRTweetView to view hierarchy



I am receiving the following assertion when adding a TWTRTweetView to the view hierarchy:

Fatal Exception: NSInternalInconsistencyException
Invalid parameter not satisfying: placeValue > 0

And it spawns from:

*** Assertion failure in CFIndex NSISSparseVectorAddTermWithPlaceValueCoefficientStartingIndex(NSISSparseVector, NSISPlaceValue_t, NSISFloat_t, NSISFloat_t, CFIndex)(), /SourceCache/Foundation/Foundation-1142.14/Layout.subproj/IncrementalSimplex/NSISCommon.m:246

This assertion only occurs on a device. The device type is an iPhone 6. I haven’t tried any other device. The crash does not occur in the simulator. I have tried many simulated devices and all the TWTRTweetViews render correctly.

Has anyone seen this before? I feel I must be abusing the API somehow, but I am following the guides. The Google seemed to be no help either…!


Hi campbellgambill,

Would you be able to provide some code on where or how you are adding the TWTRTweetViews?



I am displaying TWTRTweetViews inside collection view cells. Here is the what the code inside cellForItemAtIndexPath looks like:

TWTRTweet *tweet = self.tweetArray[indexPath.row];
[cell.tweetView configureWithTweet:tweet];
cell.tweetView.delegate = self;
cell.tweetView.frame = cell.bounds;   

And here is what the code inside my custom collection view cell looks like as far as initializing the tweet view and adding it to the view hierarchy:

- (void)layoutSubviews
    [super layoutSubviews];

    if (!self.tweetView.superview) {
        [self.contentView addSubview:self.tweetView];

- (TWTRTweetView *)tweetView
    if (!_tweetView) {
        _tweetView = [[TWTRTweetView alloc] init];
        _tweetView.showBorder = NO;
    return _tweetView;

I have tried just making a TWTRTweetView in isolation in a different view controller and just adding it to the view controllers view and I get the same assertion.

closed #4