Q: How to Make Global Viewcontroller that runs in background? I am making an app that use Core Dropbox SDK and make sync of all file and folders from document directory. Now I want to make that thing global so any one can integrate that in their app but problem is when I call method of global Viewcontroller it run that method but didn't run Dropbox delegate method so how can make that work.
///This is method that i am calling from another viewcontroller    
-(void)startsync{

   self.restClient = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
self.restClient.delegate = self;
[self.restClient loadMetadata:@"/"];
}

but this doesn't work dropbox delegate method when I call this method from another viewcontroller
/// call this method from another viewcontroller
ListVC *list = [[ListVC alloc]init];
[list startsync];


A: Put below method in AppDelegate.h 
-(void)startsync;

now AppDelegate.m,
-(void)startsync{

  self.restClient = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
  self.restClient.delegate = self;
  [self.restClient loadMetadata:@"/"];
 }

Now create AppDelegate instance in yourviewcontroller.m
- (void)yourmethod{

AppDelegate *delegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];

[delegate startsync];
}

Call Method 
[self yourmethod];

