Re: NSString may not respond....
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