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 11-23-2009, 12:31 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 1
Default creating an array from another

Hi again,

I have the following array;

NSMutableArray *arrayStocks = [[NSArray alloc] initWithObjects:@"TG:ED:DELL", @"WE:DR:HHG:UU:TRF:DEF:WWS", @"WW:A:SD:QA", @"ER:DW", @"", @"", @"", @"", @"G", nil];
self.listOfItems = arrayStocks;
[arrayStocks release];

and I'd like to create another array from this one that holds the number of characters seperated by " : " . The second array should look like

NSMutableArray *arrayCount = [[NSArray alloc] initWithObjects:@"3", @"7", @"4", @"2", @"0", @"0", @"0", @"0", @"1", nil];
self.itemCount = arrayCount;
[arrayCount release];


any help is appreciated,

Thanks
cbatur is offline   Reply With Quote
Old 11-23-2009, 04:40 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 15
Default

hi,

here i'm giving a hint:

use following NSString method
- (NSArray *)componentsSeparatedByStringNSString *)separator


the above method gives you all elements separated by separator, (in ur case separator is ":")take count of those elements. i hope this will help u.
dazz is offline   Reply With Quote
Reply

Bookmarks

Tags
array, character count

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
» Stats
Members: 158,763
Threads: 89,201
Posts: 380,572
Top Poster: BrianSlick (7,129)
Welcome to our newest member, mineva2kul
Powered by vBadvanced CMPS v3.1.0

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