cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to compile and run the DBRoulette example for iOS

How to compile and run the DBRoulette example for iOS

Bob S.15
Collaborator | Level 9

I'm trying to get a better handle on how to use the objective-C Dropbox SDK.  How do you compile and run the Example project DBRoulette?  I've tried opening the DBRoulette xcode project, but it cannot find the header file for the framework: /

 

Users/bob/Desktop/iphone/dropbox-sdk-obj-c-master/Examples/DBRoulette/Subproject/DBRoulette/DBRoulette/AppDelegate.m:8:9: 'ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h' file not found

 

The "ObjectiveDropboxOfficial.xcodeproj" project appears in red as part of DBRoulette, so there must be some issue with it not finding it.  I tried dragging it in myself and replacing the red version, then I compiled the framework target, but that resulted in me getting many more errors than just that first one.

 

Has anyone compiled and run this example?  I'm sure it is simple but the way this Dropbox SDK is set up is pretty unfamiliar to me, it is unlike most Objective C projects I've ever seen.  The documentation is not very Objective-C friendly IMO.

 

Thanks for any suggestions,

Bob

10 Replies 10

Greg-DB
Dropbox Staff
There are three versions of the examples provided:

https://github.com/dropbox/dropbox-sdk-obj-c/tree/master/Examples/DBRoulette

There's one for each supported installation method, and they're pre-configured for their respective installation method, but they don't come with the SDK pre-installed. You'll need to follow the instructions for the respective installation method, just as you would with your own app:

https://github.com/dropbox/dropbox-sdk-obj-c#sdk-distribution

Based on the path, it looks like you're trying the "subproject" method example. Did you finish the instructions for that?

https://github.com/dropbox/dropbox-sdk-obj-c#manually-add-subproject

Bob S.15
Collaborator | Level 9

Hey Greg,

 

I used the Carthage method for my own app.  This installed the dropbox SDK within my app folder -- and it includes the Example project(s).  

 

So  are you saying that in order to run the Example project I have to run "carthage update --platform iOS" again within the Example project's Carthage folder?  Which downloads *another* entire copy of the SDK including another Example project?  

 

If I do that, then the DBRoulette project already has the framework added, and the run script.  However, when I compile I get a lot of errors: 

 

 

ARC Semantic Issue Group
/Users/bob/Desktop/iphone/Voxel/Carthage/Checkouts/dropbox-sdk-obj-c/Examples/DBRoulette/Carthage/DBRoulette/DBRoulette/PhotoViewController.m:52:15: Receiver type 'DBError' for instance message is a forward declaration
/Users/bob/Desktop/iphone/Voxel/Carthage/Checkouts/dropbox-sdk-obj-c/Examples/DBRoulette/Carthage/DBRoulette/DBRoulette/PhotoViewController.m:53:65: Receiver type 'DBError' for instance message is a forward declaration
/Users/bob/Desktop/iphone/Voxel/Carthage/Checkouts/dropbox-sdk-obj-c/Examples/DBRoulette/Carthage/DBRoulette/DBRoulette/PhotoViewController.m:55:22: Receiver type 'DBError' for instance message is a forward declaration
/Users/bob/Desktop/iphone/Voxel/Carthage/Checkouts/dropbox-sdk-obj-c/Examples/DBRoulette/Carthage/DBRoulette/DBRoulette/PhotoViewController.m:56:53: Receiver type 'DBError' for instance message is a forward declaration
/Users/bob/Desktop/iphone/Voxel/Carthage/Checkouts/dropbox-sdk-obj-c/Examples/DBRoulette/Carthage/DBRoulette/DBRoulette/PhotoViewController.m:58:22: Receiver type 'DBError' for instance message is a forward declaration
/Users/bob/Desktop/iphone/Voxel/Carthage/Checkouts/dropbox-sdk-obj-c/Examples/DBRoulette/Carthage/DBRoulette/DBRoulette/PhotoViewController.m:59:45: Receiver type 'DBError' for instance message is a forward declaration
/Users/bob/Desktop/iphone/Voxel/Carthage/Checkouts/dropbox-sdk-obj-c/Examples/DBRoulette/Carthage/DBRoulette/DBRoulette/PhotoViewController.m:61:22: Receiver type 'DBError' for instance message is a forward declaration
/Users/bob/Desktop/iphone/Voxel/Carthage/Checkouts/dropbox-sdk-obj-c/Examples/DBRoulette/Carthage/DBRoulette/DBRoulette/PhotoViewController.m:62:55: Receiver type 'DBError' for instance message is a forward declaration
/Users/bob/Desktop/iphone/Voxel/Carthage/Checkouts/dropbox-sdk-obj-c/Examples/DBRoulette/Carthage/DBRoulette/DBRoulette/PhotoViewController.m:64:22: Receiver type 'DBError' for instance message is a forward declaration
/Users/bob/Desktop/iphone/Voxel/Carthage/Checkouts/dropbox-sdk-obj-c/Examples/DBRoulette/Carthage/DBRoulette/DBRoulette/PhotoViewController.m:65:52: Receiver type 'DBError' for instance message is a forward declaration
/Users/bob/Desktop/iphone/Voxel/Carthage/Checkouts/dropbox-sdk-obj-c/Examples/DBRoulette/Carthage/DBRoulette/DBRoulette/PhotoViewController.m:67:22: Receiver type 'DBError' for instance message is a forward declaration
/Users/bob/Desktop/iphone/Voxel/Carthage/Checkouts/dropbox-sdk-obj-c/Examples/DBRoulette/Carthage/DBRoulette/DBRoulette/PhotoViewController.m:68:55: Receiver type 'DBError' for instance message is a forward declaration
/Users/bob/Desktop/iphone/Voxel/Carthage/Checkouts/dropbox-sdk-obj-c/Examples/DBRoulette/Carthage/DBRoulette/DBRoulette/PhotoViewController.m:144:15: Receiver type 'DBError' for instance message is a forward declaration

Can you tell what I am doing wrong?

Thanks

Bob

Greg-DB
Dropbox Staff

Yes, that downloads the library and installs it into that project.

 

It looks like you're running in to an issue with the sample app not being up to date with the latest version of the library though. We're looking into it, but you can use 2.0.5 for now. That is, use a Cartfile like:

 

# ObjectiveDropboxOfficial
github "https://github.com/dropbox/dropbox-sdk-obj-c" ~> 2.0.5

Greg-DB
Dropbox Staff
For reference, the sample app has been updated to work with the latest version of the SDK.

Steve L.32
Explorer | Level 4

I keep re-visiting this v1 -> v2 project.  First there was no Objective-C path, and now there are 3 "methods".  Why is it not possible to just provide a Framework as in v1?  I have no idea what CocoaPods or Carthage is/are but it seems I must install at least Carthage on my Mac, which I have no desire to do, to do anything. True? Or am I just grumpy and missed somethoing obvious 🙂 ?

 

 

Greg-DB
Dropbox Staff

@Steve L.32 Thanks for the feedback. In the past, we've received requests to instead supply the SDK via a package manager, such as CocoaPods or Carthage. They require some setup, but it makes it easier to install updates to the SDK aftewards. I'll send this along as a request to offer the SDK as a standalone framework.

Steve L.32
Explorer | Level 4

Fair enough, thank you.  For me, an old guy, I need to spend my time on my Apps proper, so really appreciated simply droppping an officially built, fully supported framework into my Xcode project, without having to worry did I screwup building yet another few thousand lines worth of code. Learning curves get really steep at my age 🙂

 

Steve L.32
Explorer | Level 4
I too am finding it extremely difficult in making this v2 transition.  My needs are very simple: my v1 app queries metadata, and uploads and downloads files. The old DBRoulette example was simple to understand, all I needed was a key and a secret, and authentication just worked. I never even heard of OAuths and endpoints back then!
 
Now DBRoulette comes in three flavours, so which is the “better” method?  Would you give me a 25 word executive summary?  For what it’s worth I’ve already installed carthage.  I am trying the Xcode subproject method, but have a question.
 
I have built the SDK and added it to DBRoulette, updated the plist and tried a compile but the header file can’t be found, can you suggest what I have missed?  Picture of the project, which looks really good to me, follows … many thanks!
 
Steve
 

Steve L.32
Explorer | Level 4

FWIW the documented path to the Xcode subproject differs from what I found, if that matters:

 

Salamander:DBRoulette lusol$ dir Carthage/Checkouts/ObjectiveDropboxOfficial/Source/ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.xcodeproj
ls: Carthage/Checkouts/ObjectiveDropboxOfficial/Source/ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.xcodeproj: No such file or directory
Salamander:DBRoulette lusol$ dir Carthage/Checkouts/dropbox-sdk-obj-c/Source/ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.xcodeproj/
total 1048
drwxr-xr-x  6 lusol  staff     204 May 13 10:26 .
drwxr-xr-x  6 lusol  staff     204 May 13 10:26 ..
drwxr-xr-x  3 lusol  staff     102 May 13 10:26 en.lproj
-rw-r--r--  1 lusol  staff  533743 May 13 10:26 project.pbxproj
drwxr-xr-x  3 lusol  staff     102 May 13 10:26 xcshareddata
drwxr-xr-x  3 lusol  staff     102 May 13 10:26 xcuserdata
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Steve L.32 Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?