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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:28:01+00:00 2026-05-15T02:28:01+00:00

I am trying to copy one array to another: NSMutableArray *itemsCopy = [[NSMutableArray alloc]

  • 0

I am trying to copy one array to another:

NSMutableArray *itemsCopy = [[NSMutableArray alloc] initWithArray:self.items copyItems:YES];

but I get the error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Item copyWithZone:]: unrecognized selector sent to instance 0x5a74900'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x025afc99 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x026fd5de objc_exception_throw + 47
    2   CoreFoundation                      0x025b17ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x02521496 ___forwarding___ + 966
    4   CoreFoundation                      0x02521052 _CF_forwarding_prep_0 + 50
    5   CoreFoundation                      0x025108fa -[NSObject(NSObject) copy] + 42
    6   CoreFoundation                      0x025ab732 -[NSArray initWithArray:range:copyItems:] + 290
    7   CoreFoundation                      0x02513963 -[NSArray initWithArray:copyItems:] + 99
    8   MyViewController                          0x0000787d -[MyViewController tableView:didSelectRowAtIndexPath:] + 258
    9   UIKit                               0x003968f8 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1140
    10  UIKit                               0x0038d1de -[UITableView _userSelectRowAtIndexPath:] + 219
    11  Foundation                          0x000a404e __NSFireDelayedPerform + 441
    12  CoreFoundation                      0x025910c3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
    13  CoreFoundation                      0x02592704 __CFRunLoopDoTimer + 1364
    14  CoreFoundation                      0x024ef089 __CFRunLoopRun + 1817
    15  CoreFoundation                      0x024ee600 CFRunLoopRunSpecific + 208
    16  CoreFoundation                      0x024ee521 CFRunLoopRunInMode + 97
    17  GraphicsServices                    0x02db52c8 GSEventRunModal + 217
    18  GraphicsServices                    0x02db538d GSEventRun + 115
    19  UIKit                               0x00332e8f UIApplicationMain + 1160
    20  MyViewController                          0x0000210c main + 102
    21  MyViewController                          0x0000209d start + 53
)
terminate called after throwing an instance of 'NSException'
  • 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-05-15T02:28:02+00:00Added an answer on May 15, 2026 at 2:28 am

    You need to make sure all the contents of self.items adopt the NSCopying protocol.

    If you just want a shallow copy, send the -mutableCopy message to self.items.

    NSMutableArray *itemsCopy = [self.items mutableCopy];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

identifierListController.nameArray = [[NSMutableArray alloc] initWithArray:nameArrayT copyItems:YES]; namearray is array of view controllers. I am
Basically I'm trying to copy a file from one place to another but I
Hi I'm trying to copy one row from DataTable to another, I looked almost
I am trying to copy a column from one sheet to another. The code
I'm trying to copy the <options> HTML Codes from one select list to another.
Greetings, I am trying to perform a copy from one vector (vec1) to another
I am trying to copy a struct array to device.I am working with one
Ok im trying to loop through a 2d array to copy from one to
I am trying to copy an Ascii string to a byte array but am
I'm trying to make a copy constructor for an object and one of the

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.