Note that there are some explanatory texts on larger screens.

plurals
  1. POIBOutlet isn't connected in awakeFromNib
    primarykey
    data
    text
    <p>The sample code linked here works great and allows a UIScrollView to display images with paging and preview of the images before and after the current image: </p> <ul> <li><a href="http://blog.proculo.de/archives/180-Paging-enabled-UIScrollView-With-Previews.html">http://blog.proculo.de/archives/180-Paging-enabled-UIScrollView-With-Previews.html</a></li> <li><a href="https://github.com/alexrepty/Paging-Enabled-UIScrollView-With-Previews">https://github.com/alexrepty/Paging-Enabled-UIScrollView-With-Previews</a></li> </ul> <p>I'm trying to encapsulate the example in a single control that can be reused. So I created a PagingScrollView:</p> <pre><code>@interface PagingScrollView : UIView { IBOutlet UIScrollView * scrollView; } @property (nonatomic,retain) IBOutlet UIScrollView * scrollView; @end </code></pre> <p>with dirt simple implementation</p> <pre><code>- (void) awakeFromNib { [super awakeFromNib]; NSLog(@"awake from nib"); } </code></pre> <p>In PagingScrollView.xib, I put a View containing a UIScrollView and a ARScrollViewEnhancer exactly as in the original ScrollViewPagingExampleViewController xib. Its File's Owner's class is set to PagingScrollView, and its scrollView outlet is set to the child UIScrollView.</p> <p>In ScrollViewPagingExampleViewController, I simply declare:</p> <pre><code>IBOutlet PagingScrollView *pagingScrollView; </code></pre> <p>And in IB, I drag a View, set its class to PagingScrollView, and hook up its pagingScrollView outlet to the PagingScrollView.</p> <p>In awakeFromNib, the scrollView property is nil. I would think that since the scrollView is hooked up in IB in the same nib, it would be available by this point.</p> <p>Confusingly, in ScrollViewPagingExampleViewController.xib, there is an empty outlet named scrollView. This might indicate that there is a different instance of PagingScrollView than the one defined in PagingScrollView.xib.</p> <p>As a result, I can't populate the UIScrollView with the actual child views. What am I doing wrong here?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload