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 10-07-2009, 12:25 PM   #2 (permalink)
smasher
Registered Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
smasher will become famous soon enough
Default

Updating a label multiple times in a loop doesn't make sense - you'll only see the last value. If you run your code as-is, I'd expect to see just "g" - only the last item will wind up in the label.

If I run my modified code I see 1,2,3,f,g in the log, so your array is fine:

Code:
    NSMutableArray *my_array = [[NSMutableArray alloc] initWithObjects:@"1",@"2",@"3",@"f",@"g",nil];
    //And a for cycle
    for(int i=0; i < [my_array count]; i++)
    {
    NSLog(@"item: %@",[my_array  objectAtIndex:i]);
    }
Are you modifying "i" somewhere else? Are you modifying the array somewhere else?
__________________

Free Games!
smasher is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,282
Threads: 93,959
Posts: 402,319
Top Poster: BrianSlick (7,971)
Welcome to our newest member, kurtwatson
Powered by vBadvanced CMPS v3.1.0

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