Hello
J'ai un probléme avec la classe serialmanager de cocoa que j'ai téléchargé sur
internet
Il me met le message d'erreur suivant
J'ai ecrit le code suivant :'NSString' may not respond to '+pathAtIndex'
(Message without a matching method signature will be asumed to return 'id' and
accept '...' as argument
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 - (void)applicationDidFinishLaunching:(UIApplication *)application { // Override point for customization after application launch SerialManager *portCunima; portCunima = [SerialManager alloc]; [portCunima init]; int num_port; num_port = [portCunima findRS232Ports]; NSString *path_port; path_port = [NSString pathAtIndex:num_port]; int resultat= [portCunima openInput:path_port baudrate:9600 bits:8 parity:0 stopbits:1]; if(resultat==-1) { printf("Error Communication"); } [window makeKeyAndVisible]; }
et dans serialmanager.m voici un extrait du code
(c'est pas moi qui l'ai écrit celui-là)
donc du coup ça s'execute que jusqu'à la ligne
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 - (NSString*)pathAtIndex:(int)n { if ( n < 0 || n >= numberOfPorts ) return nil ; return path[n] ; }
path_port = [NSString pathAtIndex:num_port];
avez vous une idée ?
comment corriger ma warning
Partager