Guten Morgen,
ich habe die unten stehende Methode. Sie macht das, was sie soll. Sie schreibt den Pfad einer ausgewählten Datei in ein Feld path1.
In Zeile 16 erhalte ich beim kompilieren den Fehler:
"warning: incompatible Objective-C types initializing 'struct NSString *', expected 'struct NSMutableString *'"
Mir ist nicht ganz klar, warum. Hat jemand einen Tip?
Gruss, Ronald
---
1 (void) openPanelDidEnd2:(NSOpenPanel *)openPanel
2 returnCode:(int)returnCode
3 contextInfo:(void *)contextInfo
4 {
5 NSArray *path;
6 NSMutableString *strGesamt=[NSMutableString stringWithString:@""];
7
8 int i, c;
9
10 if(returnCode == NSOKButton)
11 {
12 path = [openPanel filenames];
13 c = [path count];
14 for (i=0;i<c;i++)
15 {
16 strGesamt = [strGesamt stringByAppendingString:[path objectAtIndex:i]];
17 }
18
19 [path1 setObjectValue:strGesamt];
20 }
21 else
22 {
23 [path1 setObjectValue:@"Abbruch"];
24 }
25 }
ich habe die unten stehende Methode. Sie macht das, was sie soll. Sie schreibt den Pfad einer ausgewählten Datei in ein Feld path1.
In Zeile 16 erhalte ich beim kompilieren den Fehler:
"warning: incompatible Objective-C types initializing 'struct NSString *', expected 'struct NSMutableString *'"
Mir ist nicht ganz klar, warum. Hat jemand einen Tip?
Gruss, Ronald
---
1 (void) openPanelDidEnd2:(NSOpenPanel *)openPanel
2 returnCode:(int)returnCode
3 contextInfo:(void *)contextInfo
4 {
5 NSArray *path;
6 NSMutableString *strGesamt=[NSMutableString stringWithString:@""];
7
8 int i, c;
9
10 if(returnCode == NSOKButton)
11 {
12 path = [openPanel filenames];
13 c = [path count];
14 for (i=0;i<c;i++)
15 {
16 strGesamt = [strGesamt stringByAppendingString:[path objectAtIndex:i]];
17 }
18
19 [path1 setObjectValue:strGesamt];
20 }
21 else
22 {
23 [path1 setObjectValue:@"Abbruch"];
24 }
25 }