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 8856819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:26:37+00:00 2026-06-14T14:26:37+00:00

I am trying to copy a NSMutableArray* into NSArray*, but it does not works

  • 0

I am trying to copy a NSMutableArray* into NSArray*, but it does not works and it generates a [__NSCFString superview]: unrecognized selector sent to instance error . Here is the code:

//where gc is a NSDictionary*, recentKey is a NSString*, and _objects is a NSArray*
//gc is an singleton is used to save chache data, with NSKeyedUnarchiver class
//_objects is used to reload the UITableView's data

NSArray *savedNews = [[NSArray alloc] initWithArray:[gc objectForKey:recentkey]];

//this not works...why??
_objects = [[NSArray alloc] initWithArray:savedNews];

Resolution:

Yes, as Herman suggests, the error was external. The savedNews Array was using a class with NSEncoding with an error:

- (void)encodeWithCoder:(NSCoder *)encoder {
//...where element was NSString* and not "UIImageView"
// element should be imgView
    if (imgView) [encoder encodeObject:element forKey:@"imgView"];
}

Thanks for all guys.

  • 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-14T14:26:38+00:00Added an answer on June 14, 2026 at 2:26 pm

    Somewhere in your App is the superview of an NSString object fetched.
    I guess that you assigned an NSString object to something where a UIView is expected.
    Could be something like:

    someButton.textLabel = someString; // wrong - but should generate a compiler warning
    

    instead of

    someButton.textLabel.text = someString; // correct
    

    This is not directly related to your array issue.

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

Sidebar

Related Questions

I am trying to copy NSMutableArray to another but it does not show me
I am trying to convert (or copy?) a NSMutableArray into a NSString. I guess
I'm trying to copy an NSString value out of an NSMutableArray into a new
trying to copy some files to C:\documents and settings\user\windows\crystal\ but can not find such
I am trying to convert (or copy?) a NSMutableArray into a NSString . I
I'm currently trying to copy data from table into another by using a SELECT
I have two NSMutableArrays: NSMutableArray* currentMessages NSMutableArray* items I am trying to copy the
I am trying to copy one array to another: NSMutableArray *itemsCopy = [[NSMutableArray alloc]
i have been trying to copy text input from alertview textfield to a NSMutableArray
I am trying to copy the objects content of a NSDictionary to a NSMutableArray,

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.