• 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
Re: NSString may not respond....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString may not respond....


  • Subject: Re: NSString may not respond....
  • From: "stephen joseph butler" <email@hidden>
  • Date: Wed, 19 Mar 2008 12:26:35 -0500

On Wed, Mar 19, 2008 at 12:10 PM, J. Todd Slack <
email@hidden> wrote:

> Hi All,
>
> Continuing my quest to get back into Cocoa/Objective-C, I am getting the
> following error stating that NSString may not respond to certain calls.
>
> Here is a screenshot:
>
> http://jasonslack.biz/pic3.png
>
> 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
>

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.
_______________________________________________

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

  • Follow-Ups:
    • [SOLVED] - Re: NSString may not respond.... -and What is this invisible character?
      • From: "J. Todd Slack" <email@hidden>
References: 
 >NSString may not respond.... (From: "J. Todd Slack" <email@hidden>)

  • Prev by Date: Re: NSString may not respond....
  • Next by Date: Re: Network communication with NSFileHandle & NSSocketPort
  • Previous by thread: Re: NSString may not respond....
  • Next by thread: [SOLVED] - Re: NSString may not respond.... -and What is this invisible character?
  • Index(es):
    • Date
    • Thread