Amazon.com Widgets Newbie-error in Xcode, some help asap please? Objective-C
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 17, 2014, 08:00:08 PM
Home Help Search chat Login Register 
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+ Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+ Old Stuff
| |-+ Help!!!
| | |-+ Newbie-error in Xcode, some help asap please? Objective-C
Pages: [1] Go Down
Print
Author Topic: Newbie-error in Xcode, some help asap please? Objective-C (Read 1595 times)
_Mac
Newbie
*
Posts: 7


iPhone Developer & Objective-C Newbie






on: May 10, 2009, 04:46:33 AM

// First: Is this the right forumdiscussion to post this? Please advice.

error: 'address' undeclared (first use of this function)
Just watched Apple video from Tech Tour: iPhone Development Tools Overview, and followed an example in the video. Got totally stuck on this (other errors happen, but of course not this one in the apple-video).

Any tips or help asap would be GREAT! I'm just stuck on this newbie-error and will not get any further without some help from you. Thank's!

Sourcefiles coming up...
Logged

--
Happy coding! Smiley
_Mac
Newbie
*
Posts: 7


iPhone Developer & Objective-C Newbie






Reply #1 on: May 10, 2009, 04:47:36 AM

Here are the first of some files I believe are involved (minus /* commented */ code):

RootViewController.h

Quote
#import <UIKit/UIKit.h>

@interface RootViewController : UIViewController {
}

- (IBAction) showNYTimes:(id)sender;
- (IBAction) showTechTalks:(id)sender;

- (void) showURL:(NSURL *)address withTitle:(NSString *)title;

@end
Logged

--
Happy coding! Smiley
_Mac
Newbie
*
Posts: 7


iPhone Developer & Objective-C Newbie






Reply #2 on: May 10, 2009, 04:48:09 AM

Here are the second (and last posted) files I believe are involved (minus /* commented */ code):

RootViewController.m
Quote

#import "RootViewController.h"
#import "SiteCheckerAppDelegate.h"
#import "MyWebViewController.h"      


@implementation RootViewController


// Egna metoder

- (IBAction) showNYTimes:(id)sender {
   [self showURL:[NSURL URLWithString:@"http://www.nytimes.com"] withTitle:@"NY Times"];
}

- (IBAction) showTechTalks:(id)sender {
   [self showURL:[NSURL URLWithString:@"http://developer.apple.com/events/iphone/techtalks/"] withTitle:@"Tech Talks"];
}


// bundle:nil  = leta efter nib-filen i mainbundle
- (void) showURL:(NSURL *)adress withTitle:(NSString *)title {
   MyWebViewController *vc = [[MyWebViewController alloc] initWithNibName:@"MyWebViewController" bundle:nil];
   vc.title = title;
   vc.location = address;
   [self.navigationController pushViewController:vc animated:YES];
   [vc release];
}

   
// **** egna metoder
   
   
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
}

- (void)dealloc {
    [super dealloc];
}


@end

Logged

--
Happy coding! Smiley
_Mac
Newbie
*
Posts: 7


iPhone Developer & Objective-C Newbie






Reply #3 on: May 10, 2009, 04:48:48 AM

BTW: Here's the Apple video i got the example from;

Video: iPhone Development Tools Overview:
https://deimos.apple.com/WebObjects/Core.woa/BrowsePrivately/adc.apple.com.1960338157.01960338163.1994285737?i=2135960322
Logged

--
Happy coding! Smiley
_Mac
Newbie
*
Posts: 7


iPhone Developer & Objective-C Newbie






Reply #4 on: May 10, 2009, 04:51:01 AM

P.s. This thread is also posted here: http://www.iphonedevsdk.com/forum/iphone-sdk-development/17982-newbie-error-xcode-some-help-asap-please.html

THANK YOU for any quick help to this newbie error! I'm just stuck...

@Stephen Kochan
Ordered your book Objective-C 2.0 2:nd edition, but have not got it yet here in Sweden...
Logged

--
Happy coding! Smiley
_Mac
Newbie
*
Posts: 7


iPhone Developer & Objective-C Newbie






Reply #5 on: May 10, 2009, 05:39:53 AM

Thank's Joe (FlyingDiver @ iphonedevsdk.com)! That solved it. The first thing you go blind on is the eyes...  ;-)

And for other newbies, I've marked the misspelling in red in the code, just to make my misstake extra clear.

Quote from: FlyingDiver;81990
You misspelled 'address' in the function declaration:


- (void) showURLNSURL *)adress withTitleNSString *)title {
MyWebViewController *vc = [[MyWebViewController alloc] initWithNibName:@"MyWebViewController" bundle:nil];
vc.title = title;
vc.location = address;
[self.navigationController pushViewController:vc animated:YES];
[vc release];
}


The error message mentioned 'address', so you should have been looking for where it was declared.  Which is in this function declaration.

joe
Logged

--
Happy coding! Smiley
Pages: [1] Go Up
Print
Jump to:



Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.