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

View Single Post
Old 04-20-2009, 02:14 AM   #24 (permalink)
Stitch
Registered Member
 
Stitch's Avatar
 
Join Date: Aug 2008
Posts: 400
Stitch is on a distinguished road
Default

What have you stored in cardsArray?

I would probably place a NSDictionary something like:

Code:
[cardsArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:
	[NSString stringWithString:@"Diamond"], @"suitKey",
	[NSString stringWithString:@"Jack"], @"cardKey",
	[NSNumber numberWithInt:10], @"valueKey",
             nil]];
This way you can easily find the Suit, Card Number and value at a specific index point in cardsArray.

Code:
int cardValue = [[[cardsArray objectAtIndex:25] objectForKey:@"valueKey"] intValue];
Stitch is offline   Reply With Quote
 

» Advertisements
» Online Users: 435
16 members and 419 guests
apatsufas, ChrisYates, dfvdan, Dimpleppanchal, Duncan C, Gaz, Hamy, itra, jeroenkeij, LegionMD, mehmood.memon, monu_rastogi, mraalex, Paxtorn, Robemtims, smithdale87
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,617
Threads: 94,087
Posts: 402,799
Top Poster: BrianSlick (7,990)
Welcome to our newest member, kellyschoemaker
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:35 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.