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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:35:30+00:00 2026-05-11T13:35:30+00:00

I have a line of code that is cause a EXC_BAD_ACCESS error. The line

  • 0

I have a line of code that is cause a ‘EXC_BAD_ACCESS’ error. The line of code is as follows (formatted into one line and nested code removed for ease of reading).

if (![sendData isEqualToString:@'-']){ ... } 

The actual error occurs on the IF line. the odd thing is that if I put a breakpoint on that line, the NSString called sendData (shown as NSCFString with a value of ‘-‘ without the quotes). Why would this be causing an error?

  • 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. 2026-05-11T13:35:30+00:00Added an answer on May 11, 2026 at 1:35 pm

    To catch this problem you’ll have to put break points in all callback methods.

    The problem is simple, the code is trying to access memory it cant find.

    Finding that line of code is harder because the callbacks are not called sequentially.

    1. Add more break points
    2. Add more NSLog(..)
    3. Consider catching exceptions (see throwing an exception in objective-c/cocoa)

    Output form the console:

    Attaching to program: `/Users/rjstelling/Library/Application Support/iPhone Simulator/User/Applications/C04A40BB-1D98-402E-BBEF-37E6FB860089/TwoViewApp.app/TwoViewApp', process 24032. Re-enabling shared library breakpoint 1 2009-04-16 16:16:45.830 TwoViewApp[24032:20b] stream event 1 2009-04-16 16:16:45.831 TwoViewApp[24032:20b] on input stream 2009-04-16 16:16:45.831 TwoViewApp[24032:20b] stream event 1 2009-04-16 16:16:45.832 TwoViewApp[24032:20b] on output stream 2009-04-16 16:16:45.832 TwoViewApp[24032:20b] stream event 4 2009-04-16 16:16:45.832 TwoViewApp[24032:20b] on output stream 2009-04-16 16:16:45.833 TwoViewApp[24032:20b] stream has space open (gdb) continue 2009-04-16 16:17:06.405 TwoViewApp[24032:20b] We made it - ok! 2009-04-16 16:17:06.406 TwoViewApp[24032:20b] stream event 2 2009-04-16 16:17:06.406 TwoViewApp[24032:20b] on input stream 2009-04-16 16:17:06.407 TwoViewApp[24032:20b] Processing: +OK CONN PinkNotes® Plus Master v5.00.26 Beta (v4 compatible) :tPNPStr 2009-04-16 16:17:06.407 TwoViewApp[24032:20b] SendData= USER (null):tPNPStr Current language:  auto; currently objective-c Program received signal:  “EXC_BAD_ACCESS”. (gdb)  

    The problem occurs some where in or after ProcessData which is a callback I think. Try and put a break point around line 157 in TwoViewAppAppDelegate.m


    It’s not that line that is causing the EXC_BAD_ACCESS if you add:

    else {     NSLog(@'We made it - ok!'); } 

    To the if() statement you can see it passes over the if ( ![sendData isEqualToString:@'-'] ){...}

    The error occurs when you return form the method call.


    Ok form you comments this might help:

    If you create strings using @'My string' the compiler will map these to he same memory if they have the same content, i.e.:

    NSString *var1 = @'string1'; NSString *anotherstring = @'string1'; NSString *morestringivars = @'string1'; 

    Will all point at the same memory space.

    This may help, but I’m not sure how? Maybe you can post more code so I can run it on my set up.


    Remember an auto release pool is created at the start of the event cycle on the iPhone.

    Therefore it is a good idea to call autorelease on sendData as soon as you assign it to the ivar.

    ...  [sendData autorelease];  ... 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 124k
  • Answers 124k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Are you running on OS 3.0? I saw the same… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer It looks like you need to register Apache::Session::Memcached with Apache::Session::Wrapper,… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer Use DATENAME or DATEPART: SELECT DATENAME(dw,GETDATE()) -- Friday SELECT DATEPART(dw,GETDATE())… May 12, 2026 at 1:19 am

Related Questions

I am pretty sure I have seen this before, but I haven't found out
So...this one has me stumped. I am using VS 2008 (C#). I have some
As many young programmers do, I learned the usefulness of inserting numerous print-to-console statements
My PHP app has an import script that can import records. At the moment,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.