enormego / EGOTableViewPullRefresh

A similar control to the pull down to refresh control created by atebits in Tweetie 2.
http://developers.enormego.com
3.26k stars 878 forks source link

Can't have hardcoded state texts #9

Open jomnius opened 14 years ago

jomnius commented 14 years ago

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..."; ... }

devindoty commented 14 years ago

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