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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-13-2008, 01:30 PM   #26 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 3
neckaros is on a distinguished road
Default

Personnaly i found this solution:
i don't use reuseIdentifier.
i load the image with NURLRequest inside the source file of my cell.
Works pretty well
neckaros is offline   Reply With Quote
Old 10-03-2008, 08:48 PM   #27 (permalink)
Go Dealloc yourself!
 
Join Date: Oct 2008
Location: Central California
Posts: 130
xnakx is on a distinguished road
Default

well i guess i should of searched better before i posted my thread.

Here

I get images to load fine but they are not indexed properly. ie cell 10 would not get the image located at index 10 of my image array. after looking a little more it seems to work ok for cells 0-9. after that all goes to heck.


any idea's
Jason
xnakx is offline   Reply With Quote
Old 08-15-2009, 12:43 PM   #28 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 58
ziophase is on a distinguished road
Default

Quote:
Originally Posted by aahmed753 View Post
basically that's what i am doing... but it seems like for every scroll table is re-reading data from url and then creating image. i checked and found that reading the data from internet is most sluggish part.

only another way i found to do is, load all images before loading the table. then get the image (instead of url) for each cell. That works well for the scrolling, but my concern is 1) loading take pretty long 2) why load all these content (table may have 20-50 rows) if user does not need to scroll down?

any comment? thanks..
Aahmed... I'd love to know how you loaded all your images.

I currently have a table which displays around 5 cells, although only two are visible without scrolling. Each has a 60x60px jpg in it. I would love to load all 5 jpgs before loading the cells. Or display the text and let the images download in the background. What I don't want is to load each image as I view the cell, and hence wait for the cell to load each time I scroll.

The images will be changing depending on where I load the table from, as users can add new images themselves, so I can't have absolute references, it needs to be relative.

Can you post some example code to do what I ask above? You seemed to have it worked out!

Cheerio,
Tim
ziophase is offline   Reply With Quote
Old 11-30-2010, 08:14 AM   #29 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 1
nopkoong is on a distinguished road
Talking

Hi , I'm newbie too. I got a way to load the image and set it up to tableview.

let's see. I have the class that manage with my cell too.

ex. MyCell Class
NSString *cell_name;
NSString *cell_view;
UIImage *cell_pic;

Step 1. in viewDidload - I load text first and set it to each cell. All data will be load in to array that we make from our MyCell Class except picture that we wait to load it. assume that all data is in MyCellArray.
Step 2. i use NSOperationQueue and NSInvocationOperation like below

NSOperationQueue *queue = [NSOperationQueue new];
NSInvocationOperation *operation = [[NSInvocationOperation alloc]
initWithTarget:self
selector:@selector(loadImage)
object:nil];
[queue addOperationperation];
[operation release];

note : at selector:@selector(loadImage) << this loadImage is function that will be load our image that we want. if you want to send String or URL you can send in >> object:YOURPARAMETER and change loadImage to loadImage:

Step 3. declare loadImage function

- (void) loadImage{
NSData* imageData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:@"imageurl.jpg"]]; // this is where the URL or Image that will be load.
UIImage* image = [[[UIImage alloc] initWithData:imageData] autorelease];
[imageData release];
[self performSelectorOnMainThread:@selector(displayImage withObject:image waitUntilDone:NO]; // displayImage is function that will be call after each image is load -- withObject:image << image is parameter or image that load completed.
}

Step 4. displayImage to tableView
- (void)displayImageUIImage *)image {
//load your image to the cell and reload
MyCell temp;
temp = [MyCellArray objectAtIndex:count]; // count is cell that will be load.
temp.cell_pic = image; // set the image to ourclass that we leave it above.
[yourtable reloadData]; // reload you table
}


in loadImage you can use loop to load many picture at once.
Same as displayImage you can use loop to set each cell of tableView.

Sorry for my bad english ><.
Hope it will help a little
nopkoong is offline   Reply With Quote
Reply

Bookmarks

Tags
uiimage, uitable, uitablecell

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: 335
9 members and 326 guests
chiataytuday, givensur, ipodphone, jbro, mer10, mtl_tech_guy, Punkjumper, vilisei, yomo710
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,881
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

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