EGOTableViewPullRefresh icon indicating copy to clipboard operation
EGOTableViewPullRefresh copied to clipboard

Can't have hardcoded state texts

Open jomnius opened this issue 14 years ago • 1 comments

If you have several lists, which each need to have different state texts, try this:

Header: NSArray *stateText; @property (nonatomic, copy) NSArray *stateText;

Code: -(void)setState { case EGOOPullRefreshPulling: if (self.stateText) statusLabel.text = [self.stateText objectAtIndex:0]; else statusLabel.text = @"Release to refresh..."; ... } - (void)dealloc { [stateText release]; stateText = nil; Use: refreshHeaderView.stateText = [NSArray arrayWithObjects: @"Release", @"Pull", @"Load", nil];

jomnius avatar Oct 28 '10 04:10 jomnius

Thanks Jomnius, definitely useful. Since we're only using each string once, hardcoding instead of storing in memory is preferred in this case :)

devindoty avatar Oct 29 '10 17:10 devindoty