0

I have the code (simplified):

#define kSendBufferSize 32768
UInt8 listingBuffer[kSendBufferSize];
NSDictionary *currentListing; 
CFIndex bufferLength;
CFDictionaryRef currentListingRef;
CFFTPCreateParsedResourceListing(kCFAllocatorDefault, listingBuffer, bufferLength, currentListingRef);
currentListing = (__bridge NSDictionary *) currentListingRef;

on the last line, I receive the following warning in XCode:

"Incompatible pointer types passing 'CFDictionaryRef' (aka 'const struct __CFDictionary *')
 to parameter of type 'CFDictionaryRef *' (aka const struct __CFDictionary **')"

The problem is that I need to declare the CFDictionaryRef with no pointer so that this line will work properly: (see Casting a CFDictionaryRef to NSDictionary?)

currentListing = (__bridge NSDictionary *) currentListingRef;

Thanks in advance.

Community
  • 1
  • 1
johnluttig
  • 750
  • 1
  • 9
  • 24

1 Answers1

0

I figured out my own answer through another forum. The key is to use the & operator when passing the CFDictionaryRef through the CFFTPCreateParsedResourceListing. For example:

CFFTPCreateParsedResourceListing(kCFAllocatorDefault, listingBuffer, bufferLength, &currentListingRef);
agf
  • 171,228
  • 44
  • 289
  • 238
johnluttig
  • 750
  • 1
  • 9
  • 24