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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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 01-14-2010, 08:33 AM   #1 (permalink)
Registered Member
 
Join Date: Dec 2009
Location: Washington, DC
Posts: 77
inlvrwetrst is on a distinguished road
Default NSArray to NSString Questions

In one view in my application, I use the checkmark component of TableCell's in order for the user to make multiple selections from a UITableView. If the row is checked, I store that cell in an NSMutableArray. I then pass that entire array to an NSMutableDictionary, which is passed to the subsequent views.

When I get to the last view, I want to take all of the information in that array and add it to one string and display it in a UITextView. This is what I am trying, but I can't figure out how to get a String out of the text since the cells use UILabels.

Code:
NSMutableArray *conFactors = [finalDictionary objectForKey:@"Contributing Factors"]; 
NSString *finalContributeString = [[NSString alloc] init]; 
for(NSUInteger i = 0; i < [conFactors count]; i ++) { 
   NSString *tempString = (NSString *)[[conFactors objectAtIndex: i] textLabel];
   finalContributeString = [finalContributeString stringByAppendingString:@", "];
   finalContributeString = [finalContributeString stringByAppendingString:tempString]; 
}
Any ideas how to take the UILabel property and get an NSString out of it??

Last edited by inlvrwetrst; 01-14-2010 at 08:39 AM.
inlvrwetrst is offline   Reply With Quote
Old 01-14-2010, 08:48 AM   #2 (permalink)
Registered Member
 
Join Date: Dec 2009
Location: Washington, DC
Posts: 77
inlvrwetrst is on a distinguished road
Default

Apologies, I didn't think that through very well. It's still early in the morning...

If anyone is curious, the solution is simple and I feel dumb...

Code:
NSString *tempString = [[[conFactors objectAtIndex: i] textLabel] text];
inlvrwetrst is offline   Reply With Quote
Reply

Bookmarks

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: 330
9 members and 321 guests
2Apps1Day, akacaj, Domele, michelle, NSString, SLIC, soohyun, Techgirl-52, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,650
Threads: 94,114
Posts: 402,886
Top Poster: BrianSlick (7,990)
Welcome to our newest member, soohyun
Powered by vBadvanced CMPS v3.1.0

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