As a newbie in iOS development (and programming), I am trying to accomplish something that I think is simple - but I need some help writing the code.
I have a mutable array that contains some facebook objects. The array is called facebookPhotosAllTemporary. I want to iterate through the array, pull out each object (a UIImage) at each index, and insert each of those images into a new array called facebookPhotosAll. Here is the code that I currently have:
In the implementation I have a private method:
- (void) addImagestoArray {
int i;
for (i = 0; i < [facebookPhotosAllTemporary count]; i++) {
UIImage *image = [UIImage imageWithData:
[NSData dataWithContentsOfURL:
[NSURL URLWithString:
[[facebookPhotosAllTemporary objectAtIndex:i]
objectForKey:@"pic_big"]]]];
[facebookPhotosAll addObject:image];
}
}
Then in the viewDidLoad section I call the method:
[self addImagestoArray];
When I run it, my NSLog message says there are no objects in the array I am trying to add objects to.
I realize my code could be completely flawed! But could someone put me on the right track? Thanks!