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 04-09-2010, 07:40 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 11
roger_iphone is on a distinguished road
Default Signal “0” error while scrolling a tableview with images

Hi,

I have a problem while scrolling images on tableview.

I am getting a Signal "0" error.

I think it is due to some memory issues but I am not able to find out the exact error. The code is as follows,

- (UITableViewCell *)tableViewUITableView *)tableView cellForRowAtIndexPathNSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [travelSummeryPhotosTable dequeueReusableCellWithIdentifier:CellIdentifier];

if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]autorelease];

}

//Photo ImageView
UIImageView *photoTag = [[UIImageView alloc] initWithFrame:CGRectMake(5.0, 5.0, 85.0, 85.0)];

NSString *rowPath =[[imagePathsDictionary valueForKey:[summaryTableViewDataArray objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row];

photoTag.image = [UIImage imageWithContentsOfFile:rowPath];
[cell.contentView addSubviewhotoTag];

[photoTag release];

// Image Caption
UILabel *labelImageCaption = [[UILabel alloc] initWithFrame:CGRectMake(110.0, 15.0, 190.0, 50.0)];
labelImageCaption.textAlignment = UITextAlignmentLeft;
NSString *imageCaptionText =[ [imageCaptionsDictionary valueForKey:[summaryTableViewDataArray objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row];
labelImageCaption.text = imageCaptionText;
[cell.contentView addSubview:labelImageCaption];
[labelImageCaption release];

return cell;

}
Thanks in advance.
roger_iphone is offline   Reply With Quote
Old 04-09-2010, 09:25 AM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

You're adding TONS of imageView's & UILabels to the cell. That's at least part of your problem. Only add the new subviews when you create a new cell, otherwise, just use the current ones
smithdale87 is offline   Reply With Quote
Old 04-13-2010, 12:29 AM   #3 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 11
roger_iphone is on a distinguished road
Default

Quote:
Originally Posted by smithdale87 View Post
You're adding TONS of imageView's & UILabels to the cell. That's at least part of your problem. Only add the new subviews when you create a new cell, otherwise, just use the current ones

Thanks for quick reply !! I have updated the code. The application is not crashing but the scrolling of TableView is very very slow. I am loading images from documents directory at the run time. Is it the reason for slow scrolling? What is the standard way of storing images? Should I create a image array and access it? Does size of the images also affects the scrolling speed? Does memory leaks in other classes cause the slow scrolling?
roger_iphone is offline   Reply With Quote
Old 04-13-2010, 09:29 AM   #4 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

Quote:
Thanks for quick reply !! I have updated the code. The application is not crashing but the scrolling of TableView is very very slow. I am loading images from documents directory at the run time. Is it the reason for slow scrolling?
Yes somewhat. How large are the images?

Quote:
What is the standard way of storing images? Should I create a image array and access it?
Keeping an array of images in memory could cause you to run out of memory if you have a lot of images.


Quote:
Does size of the images also affects the scrolling speed?
Files size or image dimension? Both will have some affect.
Quote:
Does memory leaks in other classes cause the slow scrolling?
Less memory = bad.
smithdale87 is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone, memory leaks, release, uiimage, uitableview

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: 314
15 members and 299 guests
chemistry, Domele, Fstuff, givensur, heshiming, HowEver, iAppDeveloper, iphonedevshani, jbro, JoeRCruso, kapps11, newDev, SLIC, stanny, WheyLabs
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,648
Threads: 94,112
Posts: 402,874
Top Poster: BrianSlick (7,990)
Welcome to our newest member, brandon6031
Powered by vBadvanced CMPS v3.1.0

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