[SDK] NSDictionary problems

Discussion in 'Mac Programming' started by Duke Leto, Apr 30, 2008.

  1. Duke Leto macrumors regular

    Joined:
    Mar 17, 2008
    #1
    I have been having problems accessing an object in an NSDictionary I defined.

    Is there a way to show what is in an array or dictionary on some kind of debugging console? Or can I see the contents of an IndexPath on a console?
     
  2. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #2
    Will
    Code:
    – allKeys
    then using fast enumeration over the resulting array and calling:
    Code:
    – objectForKey:
    on each then printing the key/values not do?

    -Lee
     
  3. Duke Leto thread starter macrumors regular

    Joined:
    Mar 17, 2008
    #3
    How do you print them is what I'm asking. I sorta jumped into Obj-C, XCode, and the SDK all at once so I left some knowledge behind.
     
  4. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #4
    Oh... the traditional means are:
    NSLog(NSString *format, ...);
    http://www.cocoadev.com/index.pl?NSLog
    This will go to the XCode console

    or

    fprintf(stderr,format,...);
    This will go to stderr (I think that ends up at the console in XCode as well).

    -Lee
     
  5. Duke Leto thread starter macrumors regular

    Joined:
    Mar 17, 2008
    #5
    Well I got i think I found the problem, but I have no idea why it is there.

    The array in question is in the AppDelegate. My class uses the AppDelegate to read and write from that array. This is very similar to the SimpleDrillDownApp.. However, this array does not like being in the viewWillAppear method. In any case, I may ditch the entire array idea and try to learn SQLite.

    Hopefully I will be done by June...
     

Share This Page