• 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
Two XCode questions/problems with strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Two XCode questions/problems with strings


  • Subject: Two XCode questions/problems with strings
  • From: Mike Kobb <email@hidden>
  • Date: Fri, 21 Dec 2007 23:17:32 -0800

Hi,

I spent a couple of hours in XCode this evening debugging a "bug" that turned out not to be a bug in my code at all. But, thanks to some XCode oddness, I wasted a huge amount of time. I'd appreciate some thoughts on what I can do differently in the future. Here were the two problems I had:

1) I had an NSString with the path to which I was to download a file. It's going into the user temporary directory, so the path is relatively lengthy. When I looked at the string in XCode, it appeared to be truncated a few characters before the end. I spent a long time trying to figure out why the string was being truncated before I finally figured out that the string was actually fine, but XCode was truncating the display without any indication. My string was 110 characters long, but XCode was displaying only the first 100 characters. No matter which window I looked at this string in, it appeared to be truncated, even in the tool tip. Shouldn't XCode have given me some indication that it was abbreviating the display? I finally figured out that it was okay when I looked at the memory directly.

2) After sorting out that problem, I hit another problem. My code makes the following call (where archivePath is an NSString):

    NSString *filePath = [archivePath stringByDeletingPathExtension];

This function is documented in the Apple developer docs as follows:
    - (NSString *)stringByDeletingPathExtension


Yet, when I tried to view the contents of this item, it seemed to be either empty or invalid. I tried to "View Value As..." an NSString *, but that still displayed no text. The initial class that shows up when I open the View Value As window is "NSPathStore2 *". Is there some way I could have actually viewed this result as an NSString, which is what the documentation says that the function returns? Also, given the fact that these path utilities are pretty fundamental, shouldn't XCode be able to display "Summary" information for whatever class this really is?


Thanks,
--Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Two XCode questions/problems with strings
      • From: Andrew Pontious <email@hidden>
  • Prev by Date: GuardMalloc SIGTRAP
  • Next by Date: Re: noob
  • Previous by thread: GuardMalloc SIGTRAP
  • Next by thread: Re: Two XCode questions/problems with strings
  • Index(es):
    • Date
    • Thread