<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic objective-c API v2 - getMetaData Problem with Block response in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/objective-c-API-v2-getMetaData-Problem-with-Block-response/m-p/192805#M14829</link>
    <description>&lt;P&gt;I am converting to objective C API v2. &amp;nbsp;I wrote this route to verify if a file is in a dropbox directory called DA. &amp;nbsp;I get on the NSLog that the file exits, but the BOOL return value of the function is always 0. &amp;nbsp;Any help would be appreciated.&lt;/P&gt;&lt;PRE&gt;- (BOOL)verifyFileInDropboxWith:(NSString *)fileName {
    __block BOOL fileOnDB = NO;
    NSString *dBFilePath = [NSString stringWithFormat:@"/DA/%@",fileName];
    DropboxClient *client = [DropboxClientsManager authorizedClient];
    [[client.filesRoutes getMetadata:dBFilePath]
     response:^(DBFILESMetadata *result, DBFILESGetMetadataError *routeError, DBError *error){
         if([result.name containsString:fileName])
         {
             NSLog(@"File already exists DB");
             fileOnDB = YES;
         } else {
             NSLog(@"File does not exist in DB");
             fileOnDB = NO;
         }
     }];
    return (fileOnDB);
    
}&lt;/PRE&gt;</description>
    <pubDate>Wed, 29 May 2019 09:28:42 GMT</pubDate>
    <dc:creator>ekantrowitz</dc:creator>
    <dc:date>2019-05-29T09:28:42Z</dc:date>
    <item>
      <title>objective-c API v2 - getMetaData Problem with Block response</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/objective-c-API-v2-getMetaData-Problem-with-Block-response/m-p/192805#M14829</link>
      <description>&lt;P&gt;I am converting to objective C API v2. &amp;nbsp;I wrote this route to verify if a file is in a dropbox directory called DA. &amp;nbsp;I get on the NSLog that the file exits, but the BOOL return value of the function is always 0. &amp;nbsp;Any help would be appreciated.&lt;/P&gt;&lt;PRE&gt;- (BOOL)verifyFileInDropboxWith:(NSString *)fileName {
    __block BOOL fileOnDB = NO;
    NSString *dBFilePath = [NSString stringWithFormat:@"/DA/%@",fileName];
    DropboxClient *client = [DropboxClientsManager authorizedClient];
    [[client.filesRoutes getMetadata:dBFilePath]
     response:^(DBFILESMetadata *result, DBFILESGetMetadataError *routeError, DBError *error){
         if([result.name containsString:fileName])
         {
             NSLog(@"File already exists DB");
             fileOnDB = YES;
         } else {
             NSLog(@"File does not exist in DB");
             fileOnDB = NO;
         }
     }];
    return (fileOnDB);
    
}&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 09:28:42 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/objective-c-API-v2-getMetaData-Problem-with-Block-response/m-p/192805#M14829</guid>
      <dc:creator>ekantrowitz</dc:creator>
      <dc:date>2019-05-29T09:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: objective-c API v2 - getMetaData Problem with Block response</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/objective-c-API-v2-getMetaData-Problem-with-Block-response/m-p/256117#M14830</link>
      <description>&lt;P&gt;Your function does this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;set return value to NO&lt;/P&gt;
&lt;P&gt;call a block ( which takes some time, asynchronously )&lt;/P&gt;
&lt;P&gt;immediately return the return value&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The block will not set it to another value until it's done the dropbox API call.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 03:57:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/objective-c-API-v2-getMetaData-Problem-with-Block-response/m-p/256117#M14830</guid>
      <dc:creator>mrschulz</dc:creator>
      <dc:date>2017-12-11T03:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: objective-c API v2 - getMetaData Problem with Block response</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/objective-c-API-v2-getMetaData-Problem-with-Block-response/m-p/256205#M14842</link>
      <description>Mrschulz's comment is correct, the response block is asynchronous. The result of the API call is only returned in the response block, so you should trigger whatever is relying on that value inside the response block.</description>
      <pubDate>Mon, 11 Dec 2017 16:10:35 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/objective-c-API-v2-getMetaData-Problem-with-Block-response/m-p/256205#M14842</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-12-11T16:10:35Z</dc:date>
    </item>
  </channel>
</rss>

