Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.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 05-16-2008, 09:07 PM   #1 (permalink)
New Member
 
Join Date: May 2008
Posts: 4
Default Trouble with UIImage Touch tutorial

I'm having a bit of trouble with the UIImage/Touch tutorial. I can't seem to get the image to show up on the iphone emulator. The tutorial creates the view programmatically, but I could not figure out how to get it to show up without the interface builder.

I can't even figure out how to stop the program from looking at MainWindow.xib. My code is exactly the same as in the tutorial yet I can't get an image to show up on my screen. it's pretty frustrating.

How do I stop the program from looking for MainWindow.xib?
drake is offline   Reply With Quote
Old 05-16-2008, 09:12 PM   #2 (permalink)
New Member
 
Join Date: Apr 2008
Posts: 802
Default Re: Trouble with UIImage Touch tutorial

Go into info.plist and delete MainWindow.nib at the bottom.

If you use a nib, add your views to the existing window.

if you don't use the nib then make sure to create a window and add subviews to it.
scottiphone is offline   Reply With Quote
Old 05-16-2008, 09:18 PM   #3 (permalink)
New Member
 
Join Date: May 2008
Posts: 4
Default Re: Trouble with UIImage Touch tutorial

Thanks for such a prompt response! So now the program isn't looking for a MainWindow.xib, but the image still doesn't show up. I'm going to toy with it some more, but if you have any other suggestions, I am all ears. Thanks, again!
drake is offline   Reply With Quote
Old 05-16-2008, 09:20 PM   #4 (permalink)
New Member
 
Join Date: May 2008
Posts: 4
Default Re: Trouble with UIImage Touch tutorial

Also, when I'm at the UIImage/Touch tutorial page, the information bar on the right says that it has 22 comments, yet I could only see 5. Is there an extra comment page that I don't know about?
drake is offline   Reply With Quote
Old 05-17-2008, 12:34 AM   #5 (permalink)
New Member
 
Nitrex88's Avatar
 
Join Date: Apr 2008
Location: Long Island, NY
Age: 21
Posts: 84
Send a message via AIM to Nitrex88 Send a message via Skype™ to Nitrex88
Default Re: Trouble with UIImage Touch tutorial

Hey, I am the creator of that tutorial, you could have just posted about this in the comments but whatever. All the videos have screwed up comment sections with large numbers so no, there is no extra page of comments . Unfortunately, that tutorial was made with SDK 3 or 4 where the MainWindow.xib was not really forced, just an option. Now in Beta 5 (if that's what you have) its more strict about calling the xib file. You should watch one of the newer tutorials I have made such as the Trash app in the intermediate section which sets up the imageViews in interface builder and can still handle touches. If you don't want to use interface builder then you should take a look at Spike099's tutorial in the intermediate section, called Custom Drawing. He goes over how to delete your MainWindow.xib from you project, if it still works in Beta 5. If all else fails just try to learn it with interface builder as thats what its gonna be in the final version of the iPhone SDK. Hope you enjoy all my tutorials and your welcome to ask more question by sending me an e-mail at Nitrex88@gmail.com
Nitrex88 is offline   Reply With Quote
Old 05-17-2008, 05:06 AM   #6 (permalink)
New Member
 
Join Date: May 2008
Posts: 4
Default Re: Trouble with UIImage Touch tutorial

Hi Nitrex88! Thanks so much for your reply. I will definitely check out your other tutorials that work with the beta 5 release. Also, I could not figure out how to comment on your tutorial..which is why I used the forum. Sorry about that.

Also, this might already be common knowledge, but if there are any beginners out there, I found that if you don't want to use the MainWindow.xib file (and want to use one called "DifferentView.xib" for example), you can specify it in the appdelegate.m like so:

#import "YourAppDelegate.h"
#import "Controller.h"

@implementation YourAppDelegate

@synthesize window;
@synthesize YourController;

- (void)applicationDidFinishLaunchingUIApplication *)application {

//Specify the nib file to use
Controller *aController = [[Controller alloc] initWithNibName:@"DifferentView" bundle:[NSBundle mainBundle]];
self.YourController = aController;
[aViewController release];

UIView *controllersView = [YourController view]; //get view from view controller
[window addSubview:controllersView];
}

And make SURE that the View you create in Interface Builder is connected to the File Owner object. I spent awhile digging through everything before I realized my view wasn't connected to the right NIB. (yea, i'm sure you can tell that i'm new to this stuff.)
drake is offline   Reply With Quote
Old 05-20-2008, 03:35 PM   #7 (permalink)
New Member
 
Join Date: Apr 2008
Posts: 5
Default Re: Trouble with UIImage Touch tutorial

I got it to work in Beta5 by deleting MainWindow in Info.plist from the last line.

Also change your main.m main() to look something like this - replace the last 'nil' with the name of your app delegate.

int retVal = UIApplicationMain(argc, argv, nil, @"TouchesImageAppDelegate");
bymartin 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
rotate a UIImage help ddavtian iPhone SDK Development 10 10-07-2009 11:09 PM
Getting data from an UIImage realberen iPhone SDK Development 11 03-16-2009 02:43 AM
Tutorial Request Duke Leto iPhone SDK Development 1 07-13-2008 02:53 AM
Trouble submitting to appstore? morren iPhone SDK Development 6 06-26-2008 05:41 PM
UIImage pinch to shrink tkilmer iPhone SDK Development 0 06-25-2008 12:48 AM


» Advertisements
» Online Users: 332
22 members and 310 guests
@sandris, ADY, BrianSlick, dacapo, Dani77, Dattee, dre, HDshot, HemiMG, JasonR, MarkC, mer10, nibeck, prchn4christ, ryandb2, spiderguy84, themathminister, timle8n1, tomtom100, viniciusdamone, vogueestylee, vvenkatachallam
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,883
Threads: 89,229
Posts: 380,763
Top Poster: BrianSlick (7,129)
Welcome to our newest member, vvenkatachallam
Powered by vBadvanced CMPS v3.1.0

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