IOS DBRestClient: Where to put DBREstClient
Okay. So I have 3 .h and .m files, (2 controllers and 1 delegate) and I am somewhat new to Objective C so the instructions in dropbox have been confusing to say the least. I am coming from a Javascript background and understand the logic, but not what code to use. I tried putting the code in each combination of .h and .m files. (The controller .h and .m file then the .h and .m file for the delegate then the .h and .m file for the other controller deleting the code from the previous file before trying it on another set of files)
I am deeply confused and
.h file
@interface <controller/delegate> : NSObject { DBRestClient *restClient; }
.m file
- (DBRestClient*)restClient { if (restClient == nil) { restClient = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]]; restClient.delegate = self; } return restClient; }
I can only run this code in one of the classes. A controller, but I get this error:
Incompatible pointer types assigning to id
How would I fix this and is it even in the right place?
Answers
I am posting the link of dropbox Tutorial, in which you will find dropbox api and one tutorial project.It is very nicely described there.
https://www.dropbox.com/developers/reference/sdk
Below is documentation link, you just read it once.You will get clear idea.
https://www.dropbox.com/developers/start/setup#ios
Happy Coding!!!