The ModMyTM Family of Sites:
ModMyMotoModMyiModMyGphone




 
 
Register or Connect with Facebook

Discuss AppStore Apps | Browse / Search Cydia | MMi Cydia Stats




  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > iPhone / iPod Touch SDK | Development Discussion
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 09-05-2009, 06:18 PM
What's Jailbreak?
 
Join Date: Nov 2008
Device + Firmware: iPod Touch 8GB 1G 3.0 w/Pwnage
Operating System: Ubuntu 9.04 "Jaunty"
Posts: 22
Thanks: 0
Thanked 1 Time in 1 Post
Simple app to display an image

I just want to make a simple app to display my college schedule contained in a PNG when I tap the icon. The file is in the folder and called "s.png". My code does not display the image; the program compiles but does notihng when launched, it just sits there at a black screen until i hit the home button. Can anyone tell me what I'm doing wrong? My experiencw with ObjC is limited and thus, I'm using an existing HelloWorld app as a template to accomplish my goal. (I do not intend to publicly release the program in the interest of code originality.)

#import "HelloWorldApp.h"

@implementation HelloWorldApp
- (void) applicationDidFinishLaunching: (id) unused
{
UIWindow *window;

window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

myImage = [UIImageView alloc];
initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 480.0f);
[myImage setImage:[UIImage imageNamed:@"s.png"]];

mainView = [[UIView alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
[mainView addSubview:myImage];

[window makeKeyAndVisible];
[window addSubview: mainView];

}
@end
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #2  
Old 09-06-2009, 09:18 AM
What's Jailbreak?
 
Join Date: Jun 2008
Device + Firmware: iPod touch 2G, Firmware 3.1 Beta 2, Non-Jailbroken
Operating System: iMac8,1 20", 2GB RAM, 230GB HDD
Location: Akron, OH
Posts: 22
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via AIM to gojohnnyboi

I think a better solution would be to display what you need in a UITableView.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #3  
Old 10-25-2009, 12:01 AM
What's Jailbreak?
 
Join Date: Oct 2009
Device + Firmware: iPhone 3G 3.0 Jailbroken
Operating System: Sony Vaio tinyXP
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

CGRect myImageRect = CGRectMake(0.0f, 0.0f, 320.0f, 109.0f);
UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect];
[myImage setImage:[UIImage imageNamed:@"s.png"]];
myImage.opaque = YES; // explicitly opaque for performance
[self.view addSubview:myImage];
[myImage release];
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #4  
Old 10-25-2009, 04:59 AM
iPhone? More like MyPhone
 
Join Date: Jun 2009
Location: Houston
Posts: 278
Thanks: 0
Thanked 4 Times in 4 Posts

It can be done without any coding and I think that should be better than anything.Drag an image from the finder to the resources section of the project outline. Xcode infers the action from the file type, and images will be copied to the Resources folder.
Once the image is added to your project, the UIImageView inspector image name will autocomplete your image name, and all should work.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
Reply

  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > iPhone / iPod Touch SDK | Development Discussion

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



Go to Top
ModMyI

All times are GMT -6. The time now is 10:34 PM. Powered by vBulletin® Version 3.8.4
If you need Dedicated Server Hosting, you should check out SingleHop. | Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 Copyright © 2007-09 by ModMy, LLC. All rights reserved.

iPhone News / iPhone Forums / Apple News / Apple Forums / RSS / Contact Us / / Top