objective c - NSString method deprecated, but replacement not there? -


i (re)building project written in objective c in xcode 3.2.6 64 bit under 10.6.8 vm based on 10.5 sdk (for compatibility 10.5 , - given.) build , working. but. i'm trying address last 4 warnings in project. they're same warning. specifically...

in project, there 4 ascii c strings need converted 4 corresponding instances of objective c's nsstring. there 4 identical cases. how it's being done:

[tf setstringvalue: [nsstring stringwithcstring: strg]] 

this works, results in (four) warnings stringwithcstring deprecated , looking further, find that's been true since 10.4. i'd expect 10.5 sdk have whatever replacement required.

looking @ docs, suggested replacement is:

[tf setstringvalue: [nsstring stringwithcstring:nsasciistringencoding: strg]] 

however, when used, xcode says:

'nsstring' may not respond '+stringwithcstring::' 

which means won't respond. , besides, if does, replacing 1 warning another.... yech.

anyone know should doing differently? realize old, old stuff, surely in day people didn't let these warnings clutter builds? have got kind of syntax error here, or... ?

[nsstring stringwithcstring:nsasciistringencoding: strg]

the problem don't know objective-c (it seems), you've made total mess of method call. in effect, code nonsense; i'm surprised compiled @ all. correct syntax calling this method is:

[nsstring stringwithcstring:strg encoding:nsasciistringencoding] 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -