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 11-23-2011, 03:57 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 1,106
Meredi86 is on a distinguished road
Default picking the correct image problem

Hey guys, i was about to upload an app yesterday when just before i noticed a little bug.

Basically i have a view that when tapped brings up a small scroll view at the bottom, that new scroll view holds thumbnail images. The user can tap an image from that view and it will appear on the main view. However the problem with this is that the image that appears on the main view is just the thumbnail and not the full image.

I think the problem comes from this section of code:
Code:
- (void)pickImageNamed:(NSString *)name {
    
    // first remove previous image view, if any
    [[imageScrollView viewWithTag:ZOOM_VIEW_TAG] removeFromSuperview];
    NSString *pathComponent = [NSString stringWithFormat:@"Documents/%@", name];
    NSString *imageDirectionString = [NSHomeDirectory() stringByAppendingPathComponent:pathComponent];
    UIImage *image = [UIImage imageWithContentsOfFile:imageDirectionString];
    TapDetectingImageView *zoomView = [[TapDetectingImageView alloc] initWithImage:image];
    [zoomView setDelegate:self];
    [zoomView setTag:ZOOM_VIEW_TAG];
    [imageScrollView addSubview:zoomView];
    [imageScrollView setContentSize:[zoomView frame].size];
    
    // choose minimum scale so image width fits screen
    float minScale  = [imageScrollView frame].size.width  / [zoomView frame].size.width;
    [imageScrollView setMinimumZoomScale:minScale];
    [imageScrollView setZoomScale:minScale];
    [imageScrollView setContentOffset:CGPointZero];
}
The bold line should be bringing up the issue as it is looking for a name, and that is set when the user taps the thumbnail. So instead of picking the image named: image01.png it picks the image01-thumb.png

Code:
- (void)thumbImageViewWasTapped:(ThumbImageView *)tiv {
    [self pickImageNamed:[tiv imageName]];
    [self toggleThumbView];
}
Any ideas how i should alter the code in order to stop loading the incorrect image?

Thanks for any help
Joe
Meredi86 is offline   Reply With Quote
Old 11-24-2011, 04:04 AM   #2 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 1,106
Meredi86 is on a distinguished road
Default

any thoughts on this issue?
Meredi86 is offline   Reply With Quote
Reply

Bookmarks

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: 409
15 members and 394 guests
7twenty7, chiataytuday, Clouds, dedeys78, Duncan C, e2applets, EvilElf, iekei, ipodphone, jeroenkeij, leostc, Murphy, QuantumDoja, sacha1996, Sami Gh
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,125
Posts: 402,910
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

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