Cannot Convert Array

Status
Nicht offen für weitere Antworten.

saimoto

Mitglied
Hallo,

hab ein kleines Problem.

Hier der Quelltext:

Code:
NSArray[] source = new NSArray(aContent.attributeKeys());
NSArray[] aim = new NSArray(aWebContent.attributeKeys());

		for (int i = 0; i < aim.length; i++) {
			for (int j = 0; j < source.length; i++) {

				if (aim[i].equals(source[j])) {

                                                                .......................
				}
			}
		}
Bekomme bei Initialisierung Fehlermeldung: Cannot convert from NSArray to NSArray[]
NSArray ist Typ von WebObjects.
 

jptc.org

Bekanntes Mitglied
Als erstes habe ich mal die code-Tags eingefügt, was die Lesbarkeit doch erheblich erhöht.

Zum Problem: Die Variable source ist vom Typ NSArray[] (sprich NSArray Array), also du hast ein Array an NSArrays (eindimensional). Diesem Array versuchst Du nun eine spezfische Instanz der Klasse zuzuordnen: new NSArray(...). Tja und dann hat der Compiler was gegen Dich, denn er kann die Instanz von NSArray nicht auf ein Array von NSArray konvertieren. :shock:

Karsten Voigt
http://www.java-performance-portal.org
 

Nobody

Top Contributor
Code:
for (int i = 0; i < aim.length; i++) { 
    for (int j = 0; j < source.length; i++) {

hier ist 1 bzw 2 fehler: es heist aim.length() und source.length()
 
Status
Nicht offen für weitere Antworten.
Ähnliche Java Themen
  Titel Forum Antworten Datum
Flo :3 Variablen Type dismatch: cannot convert from string to int Java Basics - Anfänger-Themen 9
T Cannot convert from Integer to int Java Basics - Anfänger-Themen 12
M Meldung "cannot convert flom boolean to boolean[]" Java Basics - Anfänger-Themen 3
C cannot convert from int to boolean Java Basics - Anfänger-Themen 3
B Fehlermeldung: cannot convert from int to byte Java Basics - Anfänger-Themen 2
S StringToInt() - Type mismatch: cannot convert from... Java Basics - Anfänger-Themen 16
G "cannot convert from long to int" - problem Java Basics - Anfänger-Themen 9
W Cannot find Symbol Java Basics - Anfänger-Themen 5
M NullPointerException: Cannot read the array length because "this.Kinder" is null Java Basics - Anfänger-Themen 1
D Cannot find JUnit.framework Java Basics - Anfänger-Themen 1
W Cannot resolve symbol 'HttpServlet' Java Basics - Anfänger-Themen 2
I JSON - cannot deserialize from Object value Java Basics - Anfänger-Themen 16
J Scanner cannot be resolved to a type Java Basics - Anfänger-Themen 3
N Fehler "Cannot instantiate the type" Java Basics - Anfänger-Themen 3
jakobfritzz Array- cannot invoke "" because "" is null Java Basics - Anfänger-Themen 4
C system cannot be resolved Fehler in Eclipse Java Basics - Anfänger-Themen 18
V ClientProtocolException cannot be resolved Java Basics - Anfänger-Themen 6
A Cannot find symbol mit Konstruktoren Java Basics - Anfänger-Themen 27
A Cannot find symbol bei exceptions Java Basics - Anfänger-Themen 2
J The import org.bukkit cannot be resolved Java Basics - Anfänger-Themen 3
J Fehlermeldung unklar. non-static variable player0 cannot be referenced from a static context Java Basics - Anfänger-Themen 4
P non-static variable cannot be referenced from a static context Java Basics - Anfänger-Themen 6
L cannot find symbol variable Kon Java Basics - Anfänger-Themen 8
L constructor cannot be applied... Java Basics - Anfänger-Themen 22
F Erste Schritte error: cannot find symbol Java Basics - Anfänger-Themen 5
M Cannot make a static reference to the non-static method Java Basics - Anfänger-Themen 10
P a cannot be resolved bei einer do while Schleife Java Basics - Anfänger-Themen 1
R return: cannot find symbol Java Basics - Anfänger-Themen 2
L Bluej Error: Cannot find Symbol Java Basics - Anfänger-Themen 13
Aprendiendo Interpreter-Fehler "non-static variable this cannot be referenced from a static context" Java Basics - Anfänger-Themen 2
M Iterator cannot refer to a non final... Java Basics - Anfänger-Themen 20
S Cannot find symbol (symbol ist eine Variable) Java Basics - Anfänger-Themen 13
N Cannot find symbol Java Basics - Anfänger-Themen 18
T Error: int cannot be dereferenced Java Basics - Anfänger-Themen 10
J JLabel cannot be resolved Java Basics - Anfänger-Themen 8
H Variablen error: non-static variable cannot be referenced from a static context Java Basics - Anfänger-Themen 4
P Cannot find symbol, wieso? Java Basics - Anfänger-Themen 5
UnityFriday method getPrevious in class List<ContentType> cannot be applied to given types Java Basics - Anfänger-Themen 29
M Erste Schritte cannot find symbol - Probleme mit Klassen Java Basics - Anfänger-Themen 6
B OOP next cannot be resolved or is not a field Java Basics - Anfänger-Themen 6
B OOP Cannot instantiate the type AuDList<Integer> Java Basics - Anfänger-Themen 18
U Erste Schritte cannot be referenced from a static context Java Basics - Anfänger-Themen 1
J Error: cannot find symbol - variable Java Basics - Anfänger-Themen 3
D Java Eclipse cannot be cast to java.awt.event.ItemListener Java Basics - Anfänger-Themen 3
F Erste Schritte parseint: cannot find symbol Java Basics - Anfänger-Themen 6
J Fehlermeldung : cannot invoke char(at) int on the primitive type int --- Anfänger Java Basics - Anfänger-Themen 5
M Erste Schritte [Variable] cannot be resolved to a variable Java Basics - Anfänger-Themen 4
M The Selection cannot be launched... Java Basics - Anfänger-Themen 4
M Vererbung - Cannot Find Symbol constructor... Java Basics - Anfänger-Themen 11
D error: cannot find symbol Java Basics - Anfänger-Themen 3
B Frage zu Beispielprogramm: "error: cannot find symbol" Java Basics - Anfänger-Themen 2
M Methoden Cannot be resolved to a variable Java Basics - Anfänger-Themen 5
BlueMountain Erste Schritte error: cannot find symbol Java Basics - Anfänger-Themen 2
P enum: cannot be resolved to a type Java Basics - Anfänger-Themen 2
W Compiler-Fehler "non-static method cannot be referenced"-Problem Java Basics - Anfänger-Themen 6
L Error: Cannot find symbol Java Basics - Anfänger-Themen 1
W int cannot be dereferenced Java Basics - Anfänger-Themen 5
P Cannot find Symbol Java Basics - Anfänger-Themen 3
K Compiler-Fehler Button cannot be resolved or is not a field Java Basics - Anfänger-Themen 6
F Methoden Cannot refer to a non-final variable.. verständnisproblem. Java Basics - Anfänger-Themen 7
A Cannot make a static reference to the non-static field Java Basics - Anfänger-Themen 6
K The Java Runtime Environment cannot be found. Java Basics - Anfänger-Themen 6
F Input/Output IOTools Fehlermeldung: cannot be resolved Java Basics - Anfänger-Themen 16
L Cannot Find Symbol - Was soll denn das bedeuten?!? Java Basics - Anfänger-Themen 7
P StdIn.readDouble: cannot find symbol Java Basics - Anfänger-Themen 7
B Fehler "Cannot find symbol - variable number1" Java Basics - Anfänger-Themen 13
P Variablen Cannot be resolved to a variable Java Basics - Anfänger-Themen 8
B Compiler-Fehler cannot find symbol Java Basics - Anfänger-Themen 6
K Date cannot be cast to java.lang.Integer Java Basics - Anfänger-Themen 4
M Methoden "Non-static method xy cannot be referenced from a static context" Java Basics - Anfänger-Themen 20
K Cannot find symbol Java Basics - Anfänger-Themen 3
H cannot find symbol Java Basics - Anfänger-Themen 4
K Objekt erstellen - error: non-static variable this cannot be referenced from a static context Java Basics - Anfänger-Themen 17
S cannot find symbol, symbol: constructor Java Basics - Anfänger-Themen 2
3 Compiler-Fehler Fehlerbehebung cannot find Symbol Java Basics - Anfänger-Themen 4
R Compiler-Fehler Cannot find symbol (Method printIn) Java Basics - Anfänger-Themen 3
H non-static method cannot be referenced from a static context Java Basics - Anfänger-Themen 2
L Cannot make a static reference to the non-static method Java Basics - Anfänger-Themen 6
B Polymorphie A obj = new B; "cannot find symbol app()" Java Basics - Anfänger-Themen 5
S wieso Fehlermeldung cannot find symbol hier Java Basics - Anfänger-Themen 10
K Variablen Cannot make a static reference to the non-static field time Java Basics - Anfänger-Themen 6
T Cannot refer to an instance field xxx while explicitly invoking a constructor Java Basics - Anfänger-Themen 14
T Cannot find Symbol(String) Java Basics - Anfänger-Themen 9
2 Compiler-Fehler cannot find symbol Java Basics - Anfänger-Themen 13
N Erste Schritte import javax.media.3d....; //Fehlermeldung: cannot be resolved Java Basics - Anfänger-Themen 10
B Erste Schritte cannot find symbol - problem Java Basics - Anfänger-Themen 9
P Compiler-Fehler Cannot make a static reference to the non-static field process Java Basics - Anfänger-Themen 3
K int cannot be dereferenced Java Basics - Anfänger-Themen 2
H LocationReferenceImpl cannot be resolved to a type Java Basics - Anfänger-Themen 5
D Cannot find symbol variable Java Basics - Anfänger-Themen 9
A Compiler-Fehler Cannot find Symbol Java Basics - Anfänger-Themen 6
M Objekt Cannot instantiate the type ... Java Basics - Anfänger-Themen 10
V Datentypen int cannot be dereferenced Java Basics - Anfänger-Themen 4
R Compiler-Fehler sequenz cannot be resolved or is not a field Java Basics - Anfänger-Themen 2
V Packages: Cannot find symbol Java Basics - Anfänger-Themen 12
G Collections.binarySearch(LinkedList): cannot find method Java Basics - Anfänger-Themen 6
M Datentypen java.util.Arrays$ArrayList cannot be cast to [Ljava.lang.String; Java Basics - Anfänger-Themen 11
T Cannot be resolved to a variable Java Basics - Anfänger-Themen 8
E Klassen ClassCastException bei gleichnamigem: paket.klasse cannot be cast to paket.klasse Java Basics - Anfänger-Themen 10
C i cannot be resolved (obwohl es im schleifekopf initialisiert worden ist) Java Basics - Anfänger-Themen 2

Ähnliche Java Themen

Neue Themen


Oben