Hi in this code the protocol RefreshLibraryDropBoxDelegate
doesn't work, doesn't call the method refreshLibrary in the WVdALibraryDocumentViewController
. Why?
WVdADropboxViewController.h
:
#import <UIKit/UIKit.h>
#import <DropboxSDK/DropboxSDK.h>
@protocol RefreshLibraryDropBoxDelegate <NSObject>
@optional
-(void)refreshLibrary;
@end
@interface WVdADropboxViewController : UIViewController <DBRestClientDelegate, UITableViewDataSource, UITableViewDelegate>
{
id <RefreshLibraryDropBoxDelegate> delegate;
}
//delegate
@property (assign) id <RefreshLibraryDropBoxDelegate> delegate;
WVdADropboxViewController.m:
- (void)restClient:(DBRestClient *)client loadedFile:(NSString *)destPath
{
NSLog(@"upload complete");
[self.delegate refreshLibrary];
[[self navigationController] popViewControllerAnimated:YES];
}
WVdALibraryDocumentViewController.h:
#import <UIKit/UIKit.h>
#import "WVdACustomCell.h"
#import "WVdAViewController.h"
#import <QuartzCore/QuartzCore.h>
#import "WVdADropboxViewController.h"
@interface WVdALibraryDocumentViewController : UIViewController <UICollectionViewDataSource, UICollectionViewDelegate, RefreshLibraryDropBoxDelegate>
-(void)refreshLibrary;
WVdALibraryDocumentViewController.m:
// REFRESH LIBRARY //
-(void)refreshLibrary
{
NSLog(@"refresh");
[self getDataArrayDocumentFiles];
}