Re: Java help - adding int to integer
Re: Java help - adding int to integer
- Subject: Re: Java help - adding int to integer
- From: Dirk Bajohr <email@hidden>
- Date: Sat, 11 Sep 2004 16:06:55 +0200
Hi Amorya,
Try this:
Integer lastChapter =
(Integer)foreachFic.valueForKeyPath("email@hiddenr");
Integer nextChapter = new Integer(lastChapter.intValue() + 1);
nextPage.chapterToEdit.setNumber(nextChapter);
You can't use the operator "+" on objects. First you have to create
int's or use the Integer.add() method.
Cheers,
Dirk
Am 11.09.2004 um 14:50 schrieb Amorya North:
My statement:
nextPage.chapterToEdit.setNumber(((Integer)(foreachFic.valueForKeyPath(
"
email@hiddenr"))+1));
The error is: "Operator + cannot be applied to java.lang.Integer, int"
If I make the 1 into an Integer, it says the same but
"java.lang.Integer, java.lang.Integer"
Is it 'cos I have a key called number? or am I making some crazy java
error?
Amorya
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
--
Dirk Bajohr
iSOLUTION - Individuelle Software fuer moderne Kommunikation
Hauptstr. 50
53757 Sankt Augustin
T +49 2241 921567-0
F +49 2241 921567-89
http://www.isolution.de
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.