by
978 15
1
6
5,126
9
Top 1% !
Popular
Famous
Pearl of Wisdom
Specified
OpenSource
Popularity: 1608th place

Published on:

No tags for this snippet yet.
LanguageText
LicenseMIT_X11

IOS display the “No data is currently available. Please pull down to refresh.” message.

how to display the “No data is currently available. Please pull down to refresh.” message.
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/204254/IOS-display-the--No-data-is-currently-av?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. if ((int)([theAppDelegate.cities count])!=0) { self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; return 1; } else { // Display a message when the table is empty UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)]; messageLabel.text = @"No data is currently available. Please pull down to refresh."; messageLabel.textColor = [UIColor blackColor]; messageLabel.numberOfLines = 0; messageLabel.textAlignment = NSTextAlignmentCenter; messageLabel.font = [UIFont fontWithName:@"Palatino-Italic" size:20]; [messageLabel sizeToFit]; self.tableView.backgroundView = messageLabel; self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; } return 0; }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus