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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:00:08+00:00 2026-05-20T09:00:08+00:00

I have global stings as such: NSString *test = nil; NSString *test1 = nil;

  • 0

I have global stings as such:

NSString *test = nil;
NSString *test1 = nil;

Do I need to alloc with anything? I do change the String value constantly throughout the program, and i’m getting a EXC_BAD_ACCESS error with segmented control that kills the program.

Any suggestions?

*** Call stack at first throw:
(
    0   CoreFoundation                      0x00db6be9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x00f0b5c2 objc_exception_throw + 47
    2   CoreFoundation                      0x00db86fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x00d28366 ___forwarding___ + 966
    4   CoreFoundation                      0x00d27f22 _CF_forwarding_prep_0 + 50
    5   tipApp                              0x00005f69 -[tipAppViewController exact] + 54
    6   tipApp                              0x00004907 -[tipAppViewController segmentedControlIndexChanged] + 129
    7   UIKit                               0x002bfa6e -[UIApplication sendAction:to:from:forEvent:] + 119
    8   UIKit                               0x0034e1b5 -[UIControl sendAction:to:forEvent:] + 67
    9   UIKit                               0x00350647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
    10  UIKit                               0x0034e16c -[UIControl sendActionsForControlEvents:] + 49
    11  UIKit                               0x0038d6b2 -[UISegmentedControl setSelectedSegmentIndex:] + 574
    12  UIKit                               0x0039217e -[UISegmentedControl touchesBegan:withEvent:] + 971
    13  UIKit                               0x002e4025 -[UIWindow _sendTouchesForEvent:] + 395
    14  UIKit                               0x002c537a -[UIApplication sendEvent:] + 447
    15  UIKit                               0x002ca732 _UIApplicationHandleEvent + 7576
    16  GraphicsServices                    0x016eca36 PurpleEventCallback + 1550
    17  CoreFoundation                      0x00d98064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
    18  CoreFoundation                      0x00cf86f7 __CFRunLoopDoSource1 + 215
    19  CoreFoundation                      0x00cf5983 __CFRunLoopRun + 979
    20  CoreFoundation                      0x00cf5240 CFRunLoopRunSpecific + 208
    21  CoreFoundation                      0x00cf5161 CFRunLoopRunInMode + 97
    22  GraphicsServices                    0x016eb268 GSEventRunModal + 217
    23  GraphicsServices                    0x016eb32d GSEventRun + 115
    24  UIKit                               0x002ce42e UIApplicationMain + 1160
    25  tipApp                              0x00001a8c main + 102
    26  tipApp                              0x00001a1d start + 53
)
terminate called after throwing an instance of 'NSException'
  • Note this only happens when I start the program out, all strings are nil, and I hit all buttons on the segemented control

I’m just not sure exactly what is going on here

  • 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-20T09:00:09+00:00Added an answer on May 20, 2026 at 9:00 am

    You have to retain that strings and release every time you reassign new value. It doesn’t matter whether it is static variable or ivar. The same memory rules are applied:

    [test release];
    test = [@"new_value" retain];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

VB 6.0 does not have any global handler.To catch runtime errors,we need to add
I'm new to building application on Mac. I have global data that I need
I have some global variables in a Python script. Some functions in that script
Hey right now I'm using jQuery and I have some global variables to hold
I have defined the global nls_date_format on Oracle 10.2 XE as follows: alter system
I have used a static global variable and a static volatile variable in file
I have the following in my Global.asax.cs routes.MapRoute( Arrival, {partnerID}, new { controller =
I have a class Application that my global.asax inherits from. The class has this
I have a big list of global variables that each have their own setup
I have a python module that makes use of a huge dictionary global variable,

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.