EXC_BAD_ACCESS...What is it and what is it doing in my program?

As a basic exercise, I was working on this function:
void PrintIntrospectionInfo () // function definition for section 4
// code for printing "introspection info"
NSString *s1 = [NSString stringWithString: @"Assignment"];
NSString *s2 = [NSString stringWithString: @"hello world!"];
NSURL *u1 = [NSURL URLWithString: @"http://www.apple.com"];
NSURL *u2 = [NSURL URLWithString: @"http://192.168.0.197"];
NSMutableString *ms1 = [NSMutableString stringWithString: @"Assignment 1"];
// NSMutableString *ms2 = [ms1 appendString: @"B"];
NSDictionary *d1 = [NSDictionary dictionaryWithObjectsAndKeys: u1, s1, u2, s2, nil];
NSMutableArray *array = [NSMutableArray arrayWithObjects: s1, s2, u1, u2, ms1, d1, nil];
SEL selector = @selector (lowercaseString:);
for (id object in array)
NSLog (@"Class name: %@", [object className]);
NSLog (@"Is member of NSString: %@", [object isMemberOfClass: [NSString class]]);
NSLog (@"Is kind of NSString: %@", [object isKindOfClass: [NSString class]]);
NSLog (@"Responds to lowercaseString: %@", [object respondsToSelector: selector]);
if ([object respondsToSelector: selector])
NSLog (@"lowercaseString is: %@", [object performSelector: selector]);
On the first iteration of the for() loop, the second NSLog returns an EXCBADACCESS in the debugger. What is EXCBADACCESS, and why is it showing up in my program?

musicwind95 wrote:
I thought %@ was a sort of (id) format specifier
It is, but BOOL isn't an id, it is just an int.
so what is the format specifier for a BOOL value?
You can use %d, but if you want to be more clever, you can keep it as %@ but use a value of:
(value ? @"YES" : @"NO")

Similar Messages

  • HT1688 I recently upgrade my Iphone but the old one is still active. I installed the friendjectory app on my new phone but it will not open but for a few seconds ab=nd then closes. What is wrong and what do I need to do to make this app work on my new pho

    I recently upgraded my Iphone. Iinstalled the friendjectory app on the new phone but it will not open but for  few seconds and then closed. What is wrong and what do I need to do? My old phone is still active and working. Do I need to do something about that?

    Hi stanczak53,
    Welcome to Apple Support Communities.
    See this link for some tips on troubleshooting apps on your iPhone:
    Using apps on your iPhone
    http://www.apple.com/support/iphone/assistant/application/
    Best,
    Jeremy

  • HT201272 You seems not to understand what I mean and what I'm having like problem. I still have my payment recut  from October of this year when I bought 9 songs in the iTunes Store from my iPhone 4S. The problem is from all the 9 songs, 7 are still avail

    You seems not to understand what I mean and what I'm having like problem. I still have my payment receipt  from October of this year when I bought 9 songs in the iTunes Store from my iPhone 4S. The problem is from all the 9 songs I've paid for, only 7 are still available from this list on my iPhone. There is no possibility to download the other 2 without paying for them. I've spoke to the lady from Mississippi on the phone 2 days ago from about 2 hours calling from Belgium but unfortunately she couldn't help me. It's the 3rd time I complain about this. How many time shall I pay for the same songs?? If you can access my music list and my past receipts payment you will be able to find out what I mean. I went back on iTunes I've found the the songs I already downloaded in October that should be on my playlist but if I click on them it will charge me again 0,99 cents. It's been 3 years I've been using the same apple ID with my iPhones. I just wand to get my songs back without having to pay them twice or 3 times

    1. iTunes won't offer cloud downloads for songs that it "thinks" are in your library, even if it "knows" the files are missing. If you've exhaustively searched for the missing files and there is no prospect of repair by restoring to them to their original locations, or connecting to new ones, then delete that tracks that display both the missing exclamation mark and are of media kind Purchased/Protected AAC audio file. Don't hide from iTunes in the cloud when asked, close iTunes, then reopen. You can download from the cloud links or iTunes Store > Quicklinks > Purchased > Music > Not on this computer > All songs > Download all.
    2. Why? Not sure, perhaps 3rd party tools or accidental key presses combined with previously hidden warning messages when trying to organize the library. There is a hint that using the feature to downsample media as it is synced to a device may also be involved, though I've not replicated it. Whatever the reason a backup would protect your media.
    tt2

  • My phone will not load past the apple icon when trying to turn on. all it has on the screan is apple icon and a blank status bar. whats wrong? and what can i do?

    my phone will not load past the apple icon when trying to turn on. all it has on the screan is apple icon and a blank status bar. whats wrong? and what can i do?

    Hi, Just put phone in the recovery mode and restore to the factory settings. It should work.

  • What is Autofill and what does it do?

    What is autofill, and what is it supposed to do, because i was trying to fix something else on my iPod, and i pressed this thinking it might help, but now i cant play a ton of songs! I've heard you need to restore the iPod then, but will this erase all my songs?

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync all music and resync
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up                             
    - Restore to factory settings/new iOS device.

  • What is tomat and what does it do

    what is tomat and what does it do

    It is a server, where you can develop and depoly
    portals, which can be accessed anywhere in the
    network (where u can access the system)And now to give an actual competent and intelligent answer rather than this verbal vomit.
    Tomcat is "Apache Tomcat is a web container developed at the Apache Software Foundation (ASF). Tomcat implements the servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, providing an environment for Java code to run in cooperation with a web server." [1]
    For more information about Tomcat look at the Tomcat site http://tomcat.apache.org/
    And for the record if you had used Google you would have had your answer in less time then it took to post your original question.

  • What is Laserfiche and what does it do?

    What is Laserfiche and what does it do?  Does it integrate with O365? Is it a standalone plan or an add on? 

    Hi Amanda,
    Laserfiche is a robust enterprise content, document and records management platform with integrated advanced capture solutions and workflow.  Laserfiche is a certified gold partner with Microsoft, fully integrated into the Office suite, including
    Office 365 and SharePoint.
    Laserfiche provides a platform for centralized content and records storage - ranging from image files to electronic documents to voice and audio files.  It is truly an enterprise wide content management system.  Very often you will find it coupled
    with SharePoint as the back end repository because of the strong workflow designer and engine, which is much easier to use than SharePoint's. 
    Laserfiche includes advanced capture tools in its product suite that can perform automated data capture from paper records, with index fields completed automatically based on the data extracted.  It is widely know as an integrative middleware solution
    as well, and at our company Accelerated Information Systems (disclaimer - we are a Laserfiche reseller and top partner for the North East US) we are able to integrate with ANY other application.  It really is a robust solution that adds features and ease
    of use to a powerful SharePoint platform.
    As far as your final question, Laserfiche is a stand alone product, but relies heavily on Microsoft technologies as it does manage the content we create through MS Office and every day printing.
    Please let me know if you have any other specific questions and I will be more than happy to answer them on this forum thread.
    ~Chris
    Christopher R. Franzino, Sales Manager l Accelerated Information Systems
    Office: 516.822.4466 x103 l Fax: 516.871.0600 l aisww.com

  • What to uninstall and what to keep

    I have been an Adobe/Macromedia user for a very long time and I seem to have accumulated a lot of versions of some of the same software on my computer and I need to clean things up and need some help in determining what to uninstall that will not affect the performance of what I currently use.  If anyone out there could spend the time to look over my mess and assist me with this I would be extremely grateful.   What you see below I copied word for word from My Programs List and am using Windows XP Professional.  If I have placed a question mark next to an item it is because I am not sure if I still use it but I do not knowingly ever choose it from the list.  I did not uninstall older software prior to this for fear that I would not e able to gain access to pages I created in the older software using the new version.
    What I have:
    Macromedia Folder:
    Extension Manager?
    Freehand MXa no longer use
    Fireworks 8 no longer use
    Dreamweaver 8 no longer use
    Flash 8 no longer use
    Flash Video Enhancer 8 ?
    Player 8 ?
    FlashPaper 2 ?
    Homesite + ?
    Adobe Folder
    ExtendedScript Toolkit ?
    Adobe Web Standard CS3 Folder
    Bridge CS3 do not use
    Contribute CS3 use
    Device Central CS3 ?
    Dreamweaver CS3 use
    Extension Manager CS3 ?
    Fireworks CS3 use
    Flash CS3 Professional use CS3 now
    Flash  CS3 Video Enhancer ?
    Adobe Programs listed by themselves not in folder but in Programs List:
    Acrobat Distiller 7 use
    Acrobat Professional 7 use
    Adobe Bridge CS2 and CS3 this is really the major issue, can I delete Bridge CS2 without loosing functionality of other CS2      products I still use?
    Designer 7 use
    Extended Script Toolkit 2 ?
    Go Live CS2 rarely but sometimes use
    Illustrator CS2 use
    Image Ready CS2 use
    InDesign CS2 use
    Photoshop CS2 use a lot
    Stock Photos do not use
    Stock Photos CS3 so not use
    Flash CS3 use
    Contribute CS3 use
    Dreamweaver CS3 use
    My issue is what can I safely uninstall without loosing any functionality of the programs I do still use/  Bridge is the major issue.  It takes up so much space and performance I want to uninstall both CS2 and 3 because I never use it but will I loose any functionality of the other programs in the creative
    suite of which it is a part?
    Anyone who would take the time to assist me I would be extremely grateful.
    Thank you,
    Jennifer

    Bridge takes up next to no space at all. Leave it alone. As for the rest, only you know what you use and what you need.
    Bob

  • I've downloaded the new version according to Creative Cloud but when I try to launch the app the window appears saying there is a new version, so I click on download now and it crashes. What's happening and what should I do? Thanks.

    I've down loaded the new version according to Creative Cloud but when I try to launch the app the window appears saying there is a new version, so I click on download now and it crashes. What's happening and what should I do? Thanks.

    Thank you so much. I finally got it to work. I don't know why it has to be such an ordeal when it comes to Adobe products!
    Todd
    Todd McVey
    Art Direction
    201-723-0104
    [email protected]
    www.toddmcvey.com
    @mctwitthis

  • I've recently received an error message from Time Machine that my Macbook Pro's sparsebundle is in use.  What is this and what can I do about it?

    I've recently received an error message from Time Machine that my Macbook Pro's sparsebundle is in use.  What is this and what can I do about it?

    This is asked at least 5-6 times a day here.
    Look at the right hand column.. more like this.
    It is a bug in Mountain Lion.
    Read C12 http://pondini.org/TM/Troubleshooting.html
    But the fast solution.. unplug the TC.. count to 10.. plug it back in.

  • Mac user OS 10.6.8 Firefox 6.0.2. Click the Firefox icon in dock, program does not open new window. Type cmd+N to open new window, cmd+T to open new tab or cmd+L to enter URL, nothing happens. What causes this, and what can be done?

    Mac user OS 10.6.8 Firefox 6.0.2. Click the Firefox icon in dock, program does not open new window. Type cmd+N to open new window, cmd+T to open new tab or cmd+L to enter URL, nothing happens. What causes this, and what can be done?

    It's strange. The problem apparently resolved itself after I ran TechTool on it. When I clicked on Firefox last night, I had no problem opening a window. Thanks for your help. (As to your previous post, the focus was on Firefox and neither the speed keys nor the menu bar would open a window or tab of allow me to enter a URL to open a window. Strange!)

  • What are these and what are they useful for?: and

    I have seen these symbols being used in Java: << and >>, what are they and what do they do?
    Thank you.

    As DrQuincy asks how is this of use over multiplying
    and dividing?In your processor there are often different instructions for shifting, multiplying, and deleteing. Typically the shifting instructions take less time to execute and so using the shifting operator will be faster than multiplying. This assumes the compiler doesn't recognize the situation and optimize it out though.
    The >>,<<,>>>, &,|,and ^ operators are mainly useful when you need to deal with individual bits of data. For instance if you are talking to another system (thats not java) that uses a different method of storing numbers (little endian/big endian etc.), or doing something such as creating parity data for error correction. There are lots of things to do, but most a low level and its rare when you need to use them.

  • What LDB is and what are all the events we have in that..?

    Hi,
    Kindly let me know what LDB is and what are all the events we have in that..?
    Akshitha.

    Hi akshitha,
    1. A logical database is in fact
    a program only.
    2. This LDB provides two main things :
    a) a pre-defined selection screen
    which handles all user inputs and validations
    b) pre defined set of data
    based upon the user selection.
    3. So we dont have to worry about from
    which tables to fetch data.
    4. Moreover, this LDB Program,
    handles all user-authorisations
    and is efficient in all respects.
    5. tcode is SLDB.
    1. To get a taste of it.
    2. create a new z program.
    3. while creating type PNP
    in logical database field.
    4. paste this code and execute.
    REPORT ABC.
    infotypes : 0001.
    TABLES : PERNR.
    GET PERNR.
    WRITE :/ PERNR-PERNR.
    5. The selection screen which u see
    is coming from logical database PNP program.
    6. Execute
    7. U will get a list of pernr.
    SAPDBPNP
    this is the main program of LDB PNP
    which does the main work.
    SAPDB + ldb name.
    regards,
    amit m.

  • TS3694 My iPhone 3gs got an update today ios 6.1.6 but when i press install update my phone shutdown and shows connect to itunes display, after i connect to itunes it shows unknown erro (306).....whats is happening and what should i do ?

    My iPhone 3gs got an update today ios 6.1.6 but when i press install update my phone shutdown and shows connect to itunes display, after i connect to itunes it shows unknown erro (306).....whats is happening and what should i do ?

    Take a look at this post: https://discussions.apple.com/thread/5036467?tstart=0
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/TS3297
    iTunes Store loads partially or returns "Error 306" or "Error 10054"
    Proxies, parental control settings and software, security or filtering software, or a bad iTunes Store cache can cause this.
    To address proxies, Remove Internet Options proxy settings and connect to the Internet without a proxy.
    To reset iTunes Store cache:
    In iTunes, choose iTunes > Preferences (Mac) or Edit > Preferences(PC).
    Click the Advanced tab.
    Click the "Reset cache" button.
    Click OK and see if the issue is resolved.
    Adjust Parental Controls in iTunes:
    Open iTunes.
    Access iTunes preferences:
    On a Mac: From the iTunes menu, choose Preferences.
    On a Windows PC: From the Edit menu, choose Preferences.
    Click the Parental Controls tab.
    Remove restrictions on Parental Controls.
    For more information on parental controls or content filtering software, seeiTunes 10.5 for Windows: May see performance issues and blank iTunes Store.
    For more information on other security software, see iTunes: Troubleshooting security software issues.

  • When i try and download an app i get an error message saying 'error 1004 please try again later' what is this, and what shall i do?

    When i try and download an app i get an error message saying 'error 1004 please try again later' what is this, and what shall i do?

    That's what I found about error 1004 in this article: http://support.apple.com/kb/TS1275
    Error 1004 and 1013: These errors may be the result of the connection to gs.apple.com being redirected or blocked. Follow these steps to resolve these errors:
    Check security software. Ensure that communication to gs.apple.com is allowed. Follow this article for assistance with security software. iTunes for Windows: Troubleshooting security software issues.
    Check the hosts file. The restore will fail if there is an active entry to redirect gs.apple.com. Follow iTunes: Advanced iTunes Store troubleshooting to edit the hosts file or revert to default on Windows. See section "Blocked by configuration: (Mac OS X/Windows) > Rebuild network information".
    Try to restore from another known-good computer and network.
    If the errors persist on another computer, the device may need service.

  • Been trying to burn a movie onto DVD and get this "The disc can't be burned, because the device failed to calibrate the laser power level for this media" Anybody know what it means and what to do? Help! Thanks

    Been trying to burn a movie onto DVD and get this "The disc can’t be burned, because the device failed to calibrate the laser power level for this media" Anybody know what it means and what to do? Help! Thanks

    It generally means that the media is faulty or of poor quality. Most of us here use Verbatim, Maxell or Taiyo Yuden media.
    OR
    Your Superdrive may need a clean.
    If you have further questions please state what Mac, with what versions of OS X, iMovie and iDVD you are using.

Maybe you are looking for