TableView loading only the first row of array to all the cells
In my application, i'm using a mutable array to store the images which are picked from the iphone photolibrary by uiimagepicker. That part is working fine and i'm getting the count of the array incrementing each time the image is picked. The problem is that, when loading the array to the tableView, all the cells show the same image, and that too, the first element of the array.
[array addObject:thumbnail];//here array is a mutable one and thumbnail is the image object
count= [array count];//getting array count.(incrementing on each addition), is fine
NSInteger row = [indexPath row];
cell.imageView.image = [array objectAtIndex:row];// here lies the problem??????
In my application, i'm using a mutable array to store the images which are picked from the iphone photolibrary by uiimagepicker. That part is working fine and i'm getting the count of the array incrementing each time the image is picked. The problem is that, when loading the array to the tableView, all the cells show the same image, and that too, the first element of the array.
[array addObject:thumbnail];//here array is a mutable one and thumbnail is the image object
count= [array count];//getting array count.(incrementing on each addition), is fine
NSInteger row = [indexPath row];
cell.imageView.image = [array objectAtIndex:row];// here lies the problem??????
Any one knows the issue, pls give the guideline..
Thanks,
This part is fine...
I guess the thumbnail that you are adding in the array may be the same each time... i.e. The same image is added multiple times in the array...
Can you post the code which is creating this value...
Regards,
Akshay Shah.
__________________
If you think I did help you, you can always thank me by buying iHoldMore - A very nice and addictive game...
Need a mobile app. Contact Us. Ruby Solutions Pvt. Ltd.
You can mail me at akshay@ruby-solutions.com
This part is fine...
I guess the thumbnail that you are adding in the array may be the same each time... i.e. The same image is added multiple times in the array...
Can you post the code which is creating this value...
Regards,
Akshay Shah.
Any way, i've solved the problem. I just moved the creation of the array from cellForRowAtIndexPath: method to pickerDidiFinishPicking: method. Now everythinggoing fine.. Thanks for your reply