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-27-2010, 05:50 AM   #1 (permalink)
iBP
Registered Member
 
Join Date: Sep 2010
Posts: 3
iBP is on a distinguished road
Default UIImageView with .plist

I have the location of an image in a .plist file. it is stored in a string.
I also have a UIImageView that i believe to be linked properly.
But i cannot display my image.

Here is my code (based on apple's drilldownsave):

LeafViewController.m

#import "LeafViewController.h"

@implementation LeafViewController

@synthesize listContent, leafViewController, imageView;

- (void)dealloc
{
[imageView release];
[listContent release];
[leafViewController release];
[super dealloc];
}

- (UIImageView *)newImageFromResourceint)indexPath;
{

NSDictionary *item = (NSDictionary *)[listContent objectAtIndex:indexPath];

NSString *imagePath = [[NSBundle mainBundle] pathForResourceNSString *)[item objectForKey:@"icon"] ofType:@"png"];

UIImage *image = [UIImage imageWithContentsOfFile:imagePath];

return image;
}

@end

LeafViewController.h


#import <UIKit/UIKit.h>

@interface LeafViewController : UIViewController
{
IBOutlet UIImageView *imageView;
IBOutlet LeafViewController *leafViewController;
NSArray *listContent;
}

@property (nonatomic, retain) UIImageView *imageView;
@property (nonatomic, retain) NSArray *listContent;
@property (nonatomic, retain) LeafViewController *leafViewController;

@end


THANK YOU IN ADVANCE FOR HELPING
iBP is offline   Reply With Quote
Old 09-27-2010, 06:09 AM   #2 (permalink)
Registered Member
 
87vert's Avatar
 
Join Date: Sep 2010
Location: Pittsburgh
Posts: 172
87vert is on a distinguished road
Default

Quote:
Originally Posted by iBP View Post
- (UIImageView *)newImageFromResourceint)indexPath;
{

NSDictionary *item = (NSDictionary *)[listContent objectAtIndex:indexPath];

NSString *imagePath = [[NSBundle mainBundle] pathForResourceNSString *)[item objectForKey:@"icon"] ofType:@"png"];

UIImage *image = [UIImage imageWithContentsOfFile:imagePath];

return image;
}
Here the method is saying it returns an UIImageView but you are actually just returning a UIImage.
87vert is offline   Reply With Quote
Old 09-27-2010, 07:40 AM   #3 (permalink)
iBP
Registered Member
 
Join Date: Sep 2010
Posts: 3
iBP is on a distinguished road
Default

Quote:
Originally Posted by 87vert View Post
Here the method is saying it returns an UIImageView but you are actually just returning a UIImage.
so which bit would i change? uiimageview to just uiimage, or does it require more code. sorry if this seems basic but i'm a beginner.
iBP is offline   Reply With Quote
Reply

Bookmarks

Tags
plist, uiimageview

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: 350
7 members and 343 guests
headkaze, mistergreen2011, nobstudio, Objective Zero, revg, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,655
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, pungs
Powered by vBadvanced CMPS v3.1.0

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