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

  • Home
  • SEARCH
  • 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 6047963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:24:36+00:00 2026-05-23T07:24:36+00:00

New here (this forum and Xcode in general), so bear with me. I’ve spent

  • 0

New here (this forum and Xcode in general), so bear with me.

I’ve spent multiple hours off and on over the last severals days trying to track down what exactly that I’m doing wrong here, but I just don’t seem to be able to pinpoint my issue.

Here’s the relevant sections of my code (I believe).

In the header:

@interface BlahViewController : UIViewController {

  NSMutableString *display;

}

@property (nonatomic, retain) NSMutableString *display;

In the main:

@implementation BlahViewController

@synthesize display;

- (void)viewDidLoad {
    self.display = [[NSMutableString alloc] init];  
}

- (void)anotherFunction:(UIButton *)sender {

    NSString *info = [[sender titleLabel] text];

    [self.display appendString:info];
}

I run the code, press the UIButton, and I get an error. Here’s the initial throw:

  *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM appendString:]: unrecognized selector sent to instance 0x4e3d300' ***

Thanks!

EDIT: The whole stack trace was requested, so here it is (after reviewing the stack I realize there may be confusion, I’m writing a very basic calculator currently, so the ViewController, etc, should consider that backdrop and “anotherFunction” = “digitPressed” in this particular case):

* Call stack at first throw:
(

0 CoreFoundation 0x00e345a9 exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f88313 objc_exception_throw + 44
2 CoreFoundation 0x00e360bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x00da5966 __forwarding
+ 966
4 CoreFoundation 0x00da5522 _CF_forwarding_prep_0 + 50
5 Calculator 0x0000273b -[CalculatorViewController digitPressed:] + 113
6 UIKit 0x002bb4fd -[UIApplication sendAction:to:from:forEvent:] + 119
7 UIKit 0x0034b799 -[UIControl sendAction:to:forEvent:] + 67
8 UIKit 0x0034dc2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
9 UIKit 0x0034c7d8 -[UIControl touchesEnded:withEvent:] + 458
10 UIKit 0x002dfded -[UIWindow _sendTouchesForEvent:] + 567
11 UIKit 0x002c0c37 -[UIApplication sendEvent:] + 447
12 UIKit 0x002c5f2e _UIApplicationHandleEvent + 7576
13 GraphicsServices 0x01723992 PurpleEventCallback + 1550
14 CoreFoundation 0x00e15944 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 52
15 CoreFoundation 0x00d75cf7 __CFRunLoopDoSource1 + 215
16 CoreFoundation 0x00d72f83 __CFRunLoopRun + 979
17 CoreFoundation 0x00d72840 CFRunLoopRunSpecific + 208
18 CoreFoundation 0x00d72761 CFRunLoopRunInMode + 97
19 GraphicsServices 0x017221c4 GSEventRunModal + 217
20 GraphicsServices 0x01722289 GSEventRun + 115
21 UIKit 0x002c9c93 UIApplicationMain + 1160
22 Calculator 0x00002254 main + 102
23 Calculator 0x000021e5 start + 53
)
terminate called after throwing an instance of ‘NSException’
Current language: auto; currently objective-c

  • 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-23T07:24:37+00:00Added an answer on May 23, 2026 at 7:24 am

    * Terminating app due to uncaught
    exception
    ‘NSInvalidArgumentException’, reason:
    ‘-[__NSArrayM appendString:]:
    unrecognized selector sent to instance
    0x4e3d300’ *

    This indicates that you are calling appendString: an instance of some kind of NSArray, which obviously won’t work.

    Assuming that [self.display appendString:info]; is the actual source of the exception, then it is happening because self.display has likely been over-released and, coincidentally, an NSArray instance was allocated at the same place in memory.

    You could use zombie detection to debug this.

    Alternatively, you might be corrupting memory somewhere. Or, maybe, there is another assignment to display.

    In any case, whenever you have a crash, there will be a backtrace. Please post it. There is the off chance that the crash is happening somewhere else.


    5 Calculator 0x0000273b -[CalculatorViewController digitPressed:] + 113
    

    Show the source to your digitPressed: method.


    self.display = [[NSMutableString alloc] init];  
    

    That is a memory leak; it’ll be retained twice. Just do self.display = [NSMutableString string]; and self.display = nil; (in your viewDidUnload).

    But that isn’t the source of your problem; something is resetting the display variable or it is being over-released. Show all uses of display.

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

Sidebar

Related Questions

I've got this code here: SqlCommand CodeStatus = new SqlCommand(SQL, DB); DB.Open(); Reader =
Help me settle an argument here. Is this: SqlCommand cmd = new SqlCommand( sql
I want to be able to do this. MyInterface interface = new ServiceProxyHelper<ProxyType>(); Here's
Solution I did some googling and found this forum post , and here is
here the code found in this forum and i need to stored the 10
I am new to this forum and not well aware of protocols of this
I'm new to C# (asp.net) so i need little help. On this forum I
This is my first post in any forum so please bear with me. I
I am new here so first of all my greetings to you I am
I'm starting a new project here (Windows Forms). What's the best option today for

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.