Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-22-2009, 09:49 AM   #1 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 79
Default Cast NSString into NSMutableString

Is there any way to take the text from a UITextField and put it into a NSMutableString without the warning: "initialization from distinct Obj-c type."

Or is there simply a way to turn a regular string into an NSMutableString?
joshholat is offline   Reply With Quote
Old 03-22-2009, 09:52 AM   #2 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 79
Default

Quote:
Originally Posted by joshholat View Post
Is there any way to take the text from a UITextField and put it into a NSMutableString without the warning: "initialization from distinct Obj-c type."

Or is there simply a way to turn a regular string into an NSMutableString?
Nevermind, I got it!
joshholat is offline   Reply With Quote
Old 03-22-2009, 10:30 AM   #3 (permalink)
Registered Member
 
Forsworn's Avatar
 
Join Date: Oct 2008
Location: Germany
Posts: 504
Default

Remember to post the solution, when you've solved your problem.
Someone might look at this thread in the future.

Code:
NSMutableString *mutableString = [NSMutableString stringWithString:textField.text];
Forsworn is offline   Reply With Quote
Old 02-08-2010, 02:18 PM   #4 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 1
Default

I have a similar problem, in that scanf("%s", <var_name>) isn't working. I'm guessing that I need to do something to convert to NSMutableString?

[edit]
If I should be using another method to read in NSMutableString from the keyboard, please feel free to bring it to my attention.
[/edit]
Rhishisikk is offline   Reply With Quote
Old 11-19-2010, 02:21 AM   #5 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 10
Default

Hi Josh, could you please post your solution, I am having the same problem for my iphone application. Please help. Thanks
sebastien is offline   Reply With Quote
Reply

Bookmarks

Tags
mutable, nsstring, string

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 252
19 members and 233 guests
ADY, Alsahir, Dani77, Desert Diva, Duncan C, F_Bryant, Grinarn, HemiMG, Herbie, jansan, linkmx, M@realobjects, macquitzon216, prchn4christ, Robiwan, smethorst, spiderguy84, twerner
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,761
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:42 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0