Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8900541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:07:19+00:00 2026-06-15T01:07:19+00:00

I have defined in my Storyboard (iPad) a view that contains a UICollectionView ,

  • 0

I have defined in my Storyboard (iPad) a view that contains a UICollectionView, at the bottom of the view there’s also a UIToolbar.
In the UICollectionView I have added a UICollectionViewCell (implemented by an iPadCellCollectionViewCell class) that contains a another view that is a Core-Plot Graph (a CPTGraphHostingView class).

I have a class called X that implements the UICollectionViewDelegate and UICollectionViewDataSource.

In the class X, I build for each cell of my view (in ViewDidLoad) the Core-Plot Graph and I have the following code to link the graph to the cell of the UICollectionViewCell

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
static NSString* cellId = @"ChartCollectionId"; 

iPadCellCollectionViewCell* cell = [self.theCollectionView dequeueReusableCellWithReuseIdentifier:cellId forIndexPath:indexPath];

MyChart* chart = [_charts objectAtIndex:indexPath.row];

cell.hostingView.hostedGraph = chart.barChart;

return cell;

}

It’s working fine, all my Graphs are correctly displayed on the screen. The issue happens when the user scroll the view, then one or several cells become “blank”. I really don’t understand why.

I have found a workaround, instead of adding the CPTGraphHostingView in the UICollectionViewCell in the Interface Builder, I build it myself and the previous code becomes:

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
static NSString* cellId = @"ChartCollectionId"; 

iPadCellCollectionViewCell* cell = [self.theCollectionView dequeueReusableCellWithReuseIdentifier:cellId forIndexPath:indexPath];


[cell.contentView addSubview:[_hostingViews objectAtIndex:indexPath.row]];

return cell;

}

With this code everything is working fine. Is there any explanations why it’s not working when I’m adding the CPTGraphHostingView in the UICollectionViewCell with the IB?

Is it an issue to call “addSubview” each time the method is called? No memory leaks?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:07:20+00:00Added an answer on June 15, 2026 at 1:07 am

    This seems to be a bug in UICollectionView when using sectionInsets.
    The cells don’t get invisible, they are misplaced out of bounds sometimes on fast scrolling.

    So if you normally would have 3 items per row, you will get a forth item in one row, but no item at the first spot of the next row.

    If you set your UICollectionView to not clip to bounds, and move it on top of your UI,
    you might see this misaligned cell.

    My solution was so far to not use sectionInsets, and surround it by using contentInset and some empty space in the section headers.

    I also found some other guys at Twitter with the same problem.
    There’s also a bug report about it: 12353513

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom UITableViewCell that I defined in a storyboard. I added a
I have defined a table type PL/SQL variable and added some data there. create
I have an iPad interface defined in a storyboard, with a SplitViewController. I want
I have a collection view that contains different custom cells. These cells contain different
Here's what I have : A Storyboard with A UIViewController that contains a UITableView
In a uitableview in my storyboard, I have defined a prototype cell. In that
If i have a storyboard animation defined in xaml resources, how do i go
I have defined CSS in MasterPage so that all pages can use the same
I have an EventTrigger that will stop a few storyboards that are defined in
I have a UIButton that I create in a storyboard and assign to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.