# I'm falling at the first hurdle in Project Builder



## markpatterson (Jan 19, 2003)

Hi,

I thought I'd use the xmas / new year break to try out Project Builder, following the Currency Calculator example. It was all easy enough to follow, but I can't actually get the app to run. It compiles OK, but throws error messages when I run it. Can anyone help?

The error messages I'm getting are as below

TIA, Mark

2003-01-19 18:47:45.470 Currency Tutorial[1165] An uncaught exception was raised
2003-01-19 18:47:45.474 Currency Tutorial[1165] *** class error for 'ASKNibObjectInfo': class not loaded
2003-01-19 18:47:45.474 Currency Tutorial[1165] *** Uncaught exception: <NSArchiverArchiveInconsistency> *** class error for 'ASKNibObjectInfo': class not loaded

Currency Tutorial has exited with status 255.


----------



## symphonix (Jan 19, 2003)

I'd start by checking that you have put in the appropriate include/import statements, these are usually at the cery start of your code.


----------



## markpatterson (Jan 20, 2003)

I have just gone through the whole of the tutorial (pdf) and looked at each include and import. I don't seem to have left anything out.
Could my problem have anything to do with versions? I'm using OS X 10.1.5, and Project Builder version 2.0, April 2002 Developer Tools Beta.


----------



## g3joel (Jan 20, 2003)

Perhaps you could post your code here? Sometimes it's hard to know what's going wrong without being able to see the code.


----------



## markpatterson (Jan 20, 2003)

Well, you asked for it. Don't say I didn't warn you. Here it is:

ConverterController.h:
/* ConverterController */

#import <Cocoa/Cocoa.h>

@interface ConverterController : NSObject
{
    IBOutlet id converter;
    IBOutlet id dollarField;
    IBOutlet id rateField;
    IBOutlet id totalField;
}
- (IBAction)convertid)sender;
@end


ConvertController.m:
#import "ConverterController.h"
#import "Converter.h"

@implementation ConverterController

- (IBAction)convertid)sender
{
  float rate, amt, total;

  rate = [rateField floatValue];
  amt = [dollarField floatValue];
  total = [converter convertAmt:amt atRate:rate];

  [totalField setFloatValue:total];
  [rateField selectText:self];  
}

- (void)awakeFromNib
{
  [[ rateField window] makeKeyAndOrderFront: self];
  [rateField selectText:self];
} 

@end



Converter.h:
/* Converter */

#import <Cocoa/Cocoa.h>

@interface Converter : NSObject
{
}
- (float)convertAmtfloat)amt atRatefloat)rate;
@end



Converter.m
#import "Converter.h"

@implementation Converter
- (float)convertAmtfloat)amt atRatefloat)rate
{ 
    return amt * rate;
}
@end


----------



## bjurusik (Jan 20, 2003)

/ ConvertController.m: 
/ #import "ConverterController.h" 
/ #import "Converter.h" 

Hmmm, I'm not sure if this matters but the name of your header file (.h) and implementation file (.m) are different.  ConverterController and ConvertController.


----------



## Oscar Castillo (Jan 20, 2003)

Haven't looked at the code, but right off the top the first thing I see missing in your interface files is that after your #import you have nothing afterwards.  Being that the CurrencyConverter is a Cocoa app, you should be  importing the Cocoa/Cocoa.h interface file.


----------



## g3joel (Jan 21, 2003)

I agree with the two responses above.

Converter.h should import:
#import *Cocoa/Cocoa.h*
#import *Foundation/Foundation.h*

Converter.m should import:
#import "Converter.h"

ConverterController.h should import:
#import *Cocoa/Cocoa.h*
#import "Converter.h"

ConverterController.m should import:
#import "ConverterController.h"

P.S. the imported frameworks inside asterisks should instead be inside angle brackets, couldn't type the angle brackets because the forum thinks it is HTML code or something.


----------



## markpatterson (Jan 21, 2003)

> _Originally posted by bjurusik _
> */ ConvertController.m:
> / #import "ConverterController.h"
> / #import "Converter.h"
> ...



Sorry, I did a typo! I shouid have types ConverterController.m


----------



## markpatterson (Jan 21, 2003)

> _Originally posted by Oscar Castillo _
> *Haven't looked at the code, but right off the top the first thing I see missing in your interface files is that after your #import you have nothing afterwards.  Being that the CurrencyConverter is a Cocoa app, you should be  importing the Cocoa/Cocoa.h interface file. *



You're right, I don't know how that came across. It has 
/* ConverterController */

#import <Cocoa/Cocoa.h>

in the actual code.


----------



## markpatterson (Jan 21, 2003)

There is goes again!

the import statement must mean something in this html.
I'll try this, to show what is in the import statement:
import <Cocoa/Cocoa.h>


----------



## markpatterson (Jan 21, 2003)

Nope, that failed

Anyway, Cocoa/Cocoa.h does actually appear between angle brackets after the import


----------



## g3joel (Jan 21, 2003)

Angle brackets wont work on this forum, it interprets them as text formatting syntax.


----------



## LordCoven (Jan 22, 2003)

can you use the standard html escapes for them? Let me try:
&lt; ... &gt;


----------



## LordCoven (Jan 22, 2003)

yup - that does the trick ... just use:
& l t ;
& g t ;
without the spaces in between to get the angle brackets (stands for less than and greater than)

C


----------



## markpatterson (Jan 22, 2003)

So it turns out, unfortunately for community discussing objective C. In Mozilla Composer I find angle brackets are given like this
&lt;Cocoa/Cocoa.h&gt;

Anyway, G3-Joel, I tried adding the extra imports as you suggested, but still got that error. Thanks for the help. Any other ideas? I'd like to get this working.


----------



## markpatterson (Jan 22, 2003)

Hey, that made the angle brackets look correct. What I actually type was
&amp;lt;Cocoa/Cocoa.h&amp;gt;


----------

