• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Help parsing dictionary integer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help parsing dictionary integer


  • Subject: Help parsing dictionary integer
  • From: Dave DeLong <email@hidden>
  • Date: Fri, 10 Jun 2005 11:50:34 -0500

Hi everyone,

I managed to figure out what the problem was with my previous question (Dictionary won't write to disk).  I was grabbing the track id incorrectly, which was messing up the dictionary.

That said, I have this line in the dictionary I'm parsing:

 <key>Track ID</key><integer>3363</integer>

And this is how I'm trying to grab it (currentTrack is an NSDictionary that contains the information):

NSNumber *tID = [NSNumber numberWithUnsignedInt:[currentTrack objectForKey:@"Track ID"]];
NSString *trackID = [NSString stringWithString:[tID stringValue]];
NSLog(trackID);

Obviously something isn't working right (otherwise I wouldn't be asking a question....).  What I'm logging are numbers that are waaaaay too large:

2005-06-10 11:43:13.686 MyApp[729] 3927040
2005-06-10 11:43:13.687 MyApp[729] 23267120
2005-06-10 11:43:13.687 MyApp[729] 3889936
2005-06-10 11:43:13.687 MyApp[729] 24099552
2005-06-10 11:43:13.687 MyApp[729] 68160640
2005-06-10 11:43:13.687 MyApp[729] 23649536
2005-06-10 11:43:13.688 MyApp[729] 68533472
2005-06-10 11:43:13.688 MyApp[729] 3927808

The largest number I should be getting is 3363.  Not 68.5 million.  What do I need to do to get that integer correctly?  (and sorry for a dumb question)

Thanks!

Dave
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Help parsing dictionary integer
      • From: Eric Brunstad <email@hidden>
    • Re: Help parsing dictionary integer
      • From: Frederick Cheung <email@hidden>
  • Prev by Date: Re: Newbie-Question: Sorting Arrays
  • Next by Date: Re: Am I overreleasing something?
  • Previous by thread: Re: NSTableView drags corrupt object graph
  • Next by thread: Re: Help parsing dictionary integer
  • Index(es):
    • Date
    • Thread