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

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 12-08-2009, 12:08 AM   #1 (permalink)
Nithin
 
Join Date: Nov 2009
Location: Kerala,India
Age: 24
Posts: 26
Send a message via Yahoo to nithiniz
Question 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??????

Any one knows the issue, pls give the guideline..

Thanks,
nithiniz is offline   Reply With Quote
Old 12-08-2009, 01:21 AM   #2 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: Pune, India
Posts: 314
Send a message via Skype™ to Akshay Shah
Cool

Quote:
Originally Posted by nithiniz View Post
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
Akshay Shah is offline   Reply With Quote
Old 12-08-2009, 01:38 AM   #3 (permalink)
Nithin
 
Join Date: Nov 2009
Location: Kerala,India
Age: 24
Posts: 26
Send a message via Yahoo to nithiniz
Default

Quote:
Originally Posted by Akshay Shah View Post
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
nithiniz is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone, nsmutablearray, uitableviewcell

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: 258
18 members and 240 guests
14DEV, @sandris, ADY, ArtieFufkin10, bookesp, ckgni, Dani77, DarkAn, HemiMG, iDifferent, jakerocheleau, JasonR, prchn4christ, Rudy, ryantcb, Speed, theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,767
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:46 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0