Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

appletree11

macrumors newbie
Original poster
Mar 9, 2009
5
0
My program loads hundreds of images to a UITableView. I got it to work. The problem is that when I switch from Debug mode to Distribution, the images do not show up anywhere. It works fine in Debug mode, all the images show up. I even tested it on an actual Iphone and it works great. I don't know why switching to Distribution mode changes things. Any help will be appreciated. Here's the codes to load the images in cells:

UIImage *img = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:fileN ofType:mad:"png"]];

cell.image = img;

return cell;
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
Distribution builds are not meant to run on devices; there are solely for packing up your app for submission to Apple. Maybe you want Release configuration?
 

appletree11

macrumors newbie
Original poster
Mar 9, 2009
5
0
Hi Dejo

You have to set it to Distribution in order to submit to app store. Actually, I did it submit the app and was rejected. Are you saying that after the app is submitted to the app store, that they have to change it to Release mode? Should I submitted it again?

Thanks.
 

appletree11

macrumors newbie
Original poster
Mar 9, 2009
5
0
hi

Actually, the images are not loading for both Release and Distribution modes. Why is that? It works great in Debug, but not otherwise. Is there anything wrong with my codes.

Here's what's going on with my app. There are hundreds of images I loaded in the Resources folder. I have sql file containing info on image names and other info. I load the sql file into arrays and load images in a UITable using those info.

It's there a better way of doing this? Have anyone had experience with using lots of images in there apps? Thanks for your replies.
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
Actually, the images are not loading for both Release and Distribution modes. Why is that? It works great in Debug, but not otherwise. Is there anything wrong with my codes.
Why are you not using imagedNamed: to load your images?
Don't worry about testing in Distribution mode. That's not what it's meant for. As for why you see a difference between Debug and Release modes, that is strange.
 

appletree11

macrumors newbie
Original poster
Mar 9, 2009
5
0
Hi

I think I got it to work. I don't know why or how, but when I saved the images in Photoshop it seems to work. I had used Gimp to save the images as png. But, I guess the format it used to save it is wrong or not been recognized. But I guess, i have to resave everything in Photoshop. Thanks guys.
 

marlenez

macrumors newbie
Aug 25, 2008
14
0
He's would have memory leak problems using imageNamed even though imageWithContentsOfFile is slower it works.

If Apple ever fixes this bug imageNamed will rock!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.