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

sdkIQ for iPhone
($4.99)

Your First iPhone App
($1.99)

iPhone Code Generator
($9.99)

Dual Matches
($0.99)

Calcuccino Programmers' Calculator
($2.99)

SDKtoday
(free)

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-22-2009, 11:31 PM   #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, 03:40 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 11
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
» Online Users: 365
21 members and 344 guests
AdamSubach, anonymous@, benoitr007, bensj, Duncan C, gtyt38, Jeremy1026, lifeCoder45, maxus182, mox, Mr. Mojo Risin, Ovidius, Paul10, pofak, raheel, squidboy, ufbobbo, ultrayard077
Most users ever online was 965, 06-30-2010 at 04:26 AM.
» Stats
Members: 41,859
Threads: 49,768
Posts: 213,052
Top Poster: BrianSlick (3,138)
Welcome to our newest member, ultrayard077
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:50 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0