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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to