Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9070091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:35:58+00:00 2026-06-16T17:35:58+00:00

I have an NSMutableArray that was downloaded via FTP. The elements in the array

  • 0

I have an NSMutableArray that was downloaded via FTP. The elements in the array are CFFTPStream resource constants that are of type CFStringRef.

I would like to create a String from the “kCFFTPResourceName” constant. However being new to Objective C and iphone development I am struggling.

Everything that I have done has resulted in ARC throwing a fit or errors like:

2013-01-03 15:31:44.874 Street Light Reporter[1382:11603] -[__NSCFDictionary objectAtIndex:]: unrecognized selector sent to instance 0x6e1e930
2013-01-03 15:31:44.875 Street Light Reporter[1382:11603] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary objectAtIndex:]: unrecognized selector sent to instance 0x6e1e930'

My most recent attempt is:
CFStringRef *c = [ar objectAtIndex:4];
which doesnt work for the following two reasons:

Incompatible pointer types initializing 'CFStringRef *' (aka 'const struct __CFString **') with an expression of type 'id'

AND

Implicit conversion of an Objective-C pointer to 'CFStringRef *' (aka 'const struct __CFString **') is disallowed with ARC

I have tried all sorts of typecasting and messing around with (__bridge) and whatnot and I have had no luck.

Can anybody help me out here? Any help will be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T17:35:59+00:00Added an answer on June 16, 2026 at 5:35 pm

    You have two errors here: the first and the most severe one is that your ar object is a NSDictionary not a NSArray. That’s why performing

    CFStringRef *c = [ar objectAtIndex:4];
    

    you are getting a NSInvalidArgumentException. objectAtIndex: is a method of NSArray that you are sending to a NSdictionary instance.

    The second error is the cast. As Fernando already pointed out, you need to cast it using the __bridge keyword like follows.

    CFStringRef c = (__bridge CFStringRef)([ar objectAtIndex:4]);
    

    so that ARC will know that you are now treating that object as a C pointer.

    Note also that CFStringRef is defined as

    typedef const struct __CFString * CFStringRef;
    

    so it’s already a pointer and you have to get rid of the *.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a NSMutableArray and a NSArray . Both consist of elements that are
I have an NSMutableArray that contains a list of objects of type MyClass, with
I have two different NSMutableArray that contains some elements. Now I want the sum
I have an NSMutableArray that contains objects of type Person. The Person object contains
I have got a NSMutableArray that is structured as follow: { { AccountNumber:Test1 Type:
I have an NSMutableArray that looks like this { @active = false; @name =
I have an NSMutableArray that contains objects of type Person. The Person object contains
I have an NSMutableArray that is populated with objects of strings. For simplicity sake
I have a NSMutableArray that I need to search for a string and return
I have a NSMutableArray (called listOfSites) that is created and used in classA.m. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.