• 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
[SOLVED] - Re: NSString may not respond.... -and What is this invisible character?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SOLVED] - Re: NSString may not respond.... -and What is this invisible character?


  • Subject: [SOLVED] - Re: NSString may not respond.... -and What is this invisible character?
  • From: "J. Todd Slack" <email@hidden>
  • Date: Wed, 19 Mar 2008 11:37:01 -0700
  • Thread-topic: [SOLVED] - Re: NSString may not respond.... -and What is this invisible character?

Hi Stephen and all,

>> Can anyone explain what I am doing wrong because as far as I can see this
should be valid?

> There are many serious problems with that code. Ignoring the warning, I see:

> 1) That is not the proper way to find the user's documents folder.
<http://developer.apple.com/documentation/Cocoa/Conceptual/>
LowLevelFileMgmt/Tasks/LocatingDirectories.html#//apple_ref/doc/uid/20001279>

** I did not know this, thank you for pointing it out.

> 2) You leak an NSString with the output variable.
> 3) You can't use a "char*" to store the result from encoding with
NSUnicodeStringEncoding
> 4) You can't use strlen() with Unicode characters.
> 5) "%C" is not the correct format specifier for an ASCII character.
> 6) That is not the correct way to combine paths.

> I think you need to stop coding and get some good documents on Unicode and
possibly Cocoa memory management.

After digging deeper, I found that I was indeed encoding wrong and I did not
need to do a lot of the code I posted. Thank yo for pointing out these so
that I did indeed get some clarity. Items 2 and 3 helped the most.

What resources do you recommend? I am not against learning.....<grin>.

But one note, you mentioned stopping coding...if I did that, I would not
have dug to solve the problem...Is there not something to be said for those
that ³try and try again² until they get it right or maybe ³Practice makes
perfect²?

-Jason

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: NSString may not respond.... (From: "stephen joseph butler" <email@hidden>)

  • Prev by Date: Re: Unable to access an instance properties and methods
  • Next by Date: Re: Intercepting retain/release of object
  • Previous by thread: Re: NSString may not respond....
  • Next by thread: Intercepting retain/release of object
  • Index(es):
    • Date
    • Thread