Commit 41c8154d authored by Felix Paul Kühne's avatar Felix Paul Kühne

server browsing: fix runtime exception

parent 03211b34
......@@ -36,6 +36,13 @@
_browsingController = [[VLCServerBrowsingController alloc] initWithViewController:self serverBrowser:serverBrowser];
self.title = serverBrowser.title;
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.nothingFoundLabel.text = NSLocalizedString(@"FOLDER_EMPTY", nil);
[self.nothingFoundLabel sizeToFit];
......@@ -60,8 +67,6 @@
multiplier:1.0
constant:0.0];
[self.view addConstraint:xConstraint];
}
return self;
}
- (void)viewDidAppear:(BOOL)animated
......@@ -116,7 +121,9 @@
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return [self.serverBrowser items].count;
NSInteger count = [self.serverBrowser items].count;
self.nothingFoundView.hidden = count > 0;
return count;
}
- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath
......
......@@ -113,7 +113,9 @@
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return self.indexPaths.count;
NSInteger count = self.indexPaths.count;
self.nothingFoundView.hidden = count > 0;
return count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(nonnull NSIndexPath *)indexPath
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment