Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修订加载更多的reload调用方式 #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion oschina/ActivesView.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ - (void)clear
[imageDownloadsInProgress removeAllObjects];
[tweetDownloadsInProgress removeAllObjects];
}

- (void)reloadData:(id)noRefresh {
[self reload:[(NSNumber *)noRefresh boolValue]];
}

- (void)reload:(BOOL)noRefresh
{
if (isLoading || isLoadOver) {
Expand Down Expand Up @@ -422,7 +427,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath

if ([Config Instance].isCookie) {
if (!isLoading) {
[self performSelector:@selector(reload:)];
[self performSelector:@selector(reloadData:) withObject:[NSNumber numberWithBool:YES]];
}
}
else {
Expand Down
7 changes: 6 additions & 1 deletion oschina/FavoritesView.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ -(void)clear
[favorites removeAllObjects];
isLoadOver = NO;
}

- (void)reloadData:(id)noRefresh {
[self reload:[(NSNumber *)noRefresh boolValue]];
}

-(void)reload:(BOOL)noRefresh
{
//如果有网络连接
Expand Down Expand Up @@ -243,7 +248,7 @@ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *
int row = indexPath.row;
if (row >= favorites.count) {
if (!isLoading && !isLoadOver) {
[self performSelector:@selector(reload:)];
[self performSelector:@selector(reloadData:) withObject:[NSNumber numberWithBool:YES]];
}
}
else
Expand Down
6 changes: 5 additions & 1 deletion oschina/FriendsView.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ - (void)viewDidUnload
[super viewDidUnload];
}

- (void)reloadData:(id)noRefresh {
[self reload:[(NSNumber *)noRefresh boolValue]];
}

-(void)reload:(BOOL)noRefresh
{
if (isLoadOver) {
Expand Down Expand Up @@ -261,7 +265,7 @@ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *
int row = [indexPath row];
if (row >= friends.count) {
if (!isLoading) {
[self performSelector:@selector(reload:)];
[self performSelector:@selector(reloadData:) withObject:[NSNumber numberWithBool:YES]];
}

}
Expand Down
7 changes: 6 additions & 1 deletion oschina/MessageSystemView.m
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger
{
[Tool processLoginNotice:actionSheet andButtonIndex:buttonIndex andNav:self.parentViewController.navigationController andParent:self];
}

- (void)reloadData:(id)noRefresh {
[self reload:[(NSNumber *)noRefresh boolValue]];
}

- (void)reload:(BOOL)noRefresh
{
if (isLoading || isLoadOver) {
Expand Down Expand Up @@ -631,7 +636,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
int row = [indexPath row];
if (row >= [comments count]) {
if (!isLoading) {
[self performSelector:@selector(reload:)];
[self performSelector:@selector(reloadData:) withObject:[NSNumber numberWithBool:YES]];
}
}
else {
Expand Down
7 changes: 6 additions & 1 deletion oschina/MessageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ - (void)didReceiveMemoryWarning
m.imgData = nil;
}
}

- (void)reloadData:(id)noRefresh {
[self reload:[(NSNumber *)noRefresh boolValue]];
}

- (void)reload:(BOOL)noRefresh
{
if (isLoading || isLoadOver) {
Expand Down Expand Up @@ -390,7 +395,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
else
{
if (!isLoading) {
[self performSelector:@selector(reload:)];
[self performSelector:@selector(reloadData:) withObject:[NSNumber numberWithBool:YES]];
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion oschina/NewsView.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ - (void)clear
[news removeAllObjects];
isLoadOver = NO;
}

- (void)reloadData:(id)noRefresh {
[self reload:[(NSNumber *)noRefresh boolValue]];
}

- (void)reload:(BOOL)noRefresh
{
//如果有网络连接
Expand Down Expand Up @@ -231,7 +236,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
int row = [indexPath row];
if (row >= [news count]) {
if (!isLoading) {
[self performSelector:@selector(reload:)];
[self performSelector:@selector(reloadData:) withObject:[NSNumber numberWithBool:YES]];
}
}
else {
Expand Down
7 changes: 6 additions & 1 deletion oschina/PostsView.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ - (void)viewDidDisappear:(BOOL)animated
[allDownloads makeObjectsPerformSelector:@selector(cancelDownload)];
}
}

- (void)reloadData:(id)noRefresh {
[self reload:[(NSNumber *)noRefresh boolValue]];
}

- (void)reload:(BOOL)noRefresh
{
if ([Config Instance].isNetworkRunning) {
Expand Down Expand Up @@ -314,7 +319,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
if (row >= [posts count]) {
if (!isLoading)
{
[self performSelector:@selector(reload:)];
[self performSelector:@selector(reloadData:) withObject:[NSNumber numberWithBool:YES]];
}
}
else
Expand Down
7 changes: 6 additions & 1 deletion oschina/TwitterView.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ - (void)clear
[tweetDownloadsInProgress removeAllObjects];
isLoadOver = NO;
}

- (void)reloadData:(id)noRefresh {
[self reload:[(NSNumber *)noRefresh boolValue]];
}

- (void)reload:(BOOL)noRefresh
{
if (isLoading || isLoadOver)
Expand Down Expand Up @@ -407,7 +412,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
if (row >= [tweets count]) {
//启动刷新
if (!isLoading) {
[self performSelector:@selector(reload:)];
[self performSelector:@selector(reloadData:) withObject:[NSNumber numberWithBool:YES]];
}
}
else {
Expand Down
6 changes: 5 additions & 1 deletion oschina/UserBlogsView.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ -(void)clear
isLoadOver = NO;
}

- (void)reloadData:(id)noRefresh {
[self reload:[(NSNumber *)noRefresh boolValue]];
}

-(void)reload:(BOOL)noRefresh
{
//如果有网络连接
Expand Down Expand Up @@ -180,7 +184,7 @@ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *
int row = [indexPath row];
if (row >= [blogs count]) {
if (!isLoading) {
[self performSelector:@selector(reload:)];
[self performSelector:@selector(reloadData:) withObject:[NSNumber numberWithBool:YES]];
}
}
else {
Expand Down