IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Apple Discussion :

Message 'NSString' may not respond to '+pathAtIndex'


Sujet :

Apple

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    143
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2007
    Messages : 143
    Points : 56
    Points
    56
    Par défaut Message 'NSString' may not respond to '+pathAtIndex'
    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
    'NSString' may not respond to '+pathAtIndex'
    (Message without a matching method signature will be asumed to return 'id' and
    accept '...' as argument
    J'ai ecrit le code suivant :

    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à)

    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] ;
    }
    donc du coup ça s'execute que jusqu'à la ligne

    path_port = [NSString pathAtIndex:num_port];

    avez vous une idée ?

    comment corriger ma warning

  2. #2
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    143
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2007
    Messages : 143
    Points : 56
    Points
    56
    Par défaut
    en fait j'ai resolu ma warning

    j'ai en fait ecrit

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    NSString *path_port;
    	path_port = [[NSString alloc] pathAtIndex:num_port];
    et j'ai plus de warning

    par contre en execution il plante quand il arrive sur la ligne

    path_port = [[NSString alloc] pathAtIndex:num_port];

    il ne va pas dans la méthode pathAtIndex

  3. #3
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    143
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2007
    Messages : 143
    Points : 56
    Points
    56
    Par défaut
    OK;

    j'ai résolu mon pb mais maintenant quand j'execute mon programme
    il trouve bien 2 ports serie , l'un bluetooth et l'autre cu.iap

    Bon moi je veux utiliser Cu.iap mais il ne veut pas me l'ouvrir apparement

    Donc il me renvoie -1 sur la fonction open

    Que dois je faire ?

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. X may not respond to Y
    Par Invité dans le forum Apple
    Réponses: 3
    Dernier message: 22/03/2010, 12h35
  2. [WS 2003] Ris message erreur you may not have sufficient permissions
    Par y.menard77 dans le forum Windows Serveur
    Réponses: 0
    Dernier message: 16/01/2010, 21h26
  3. [Chart] Bars may not be rendered on a value scale
    Par jhaythem dans le forum BIRT
    Réponses: 1
    Dernier message: 28/07/2007, 23h59
  4. [2.1.2] Lines may not be rendered on a value scale
    Par jhaythem dans le forum BIRT
    Réponses: 1
    Dernier message: 26/07/2007, 17h49
  5. erreur:The local variable may not have been initialized
    Par wiss20000 dans le forum Langage
    Réponses: 7
    Dernier message: 22/03/2007, 15h18

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo