var d'instance pas recconue?

elfelf Membre
16:32 modifié dans API AppKit #1
Salut,

J'ai un problème que je ne comprens vraiment pas...

J'ai une instance d'une class perso (elle s'appelle calculator) qui est définie dans le .h de mon contrôleur d'interface comme çela:

Calculator *calculator;


Au début ça marchais mais depuis un moment ça ne marche plus du tout.

La chaque appel a cet instance n'a auccun effet, ni d'erreur.

J'ai fait des tests avec le log. j'ai même dans la class Calculator fait une fonction test:

Calculator.m
<br />//---<br />-(void)test<br />{<br />&nbsp; &nbsp; NSLog(@&quot;test concluant&quot;);<br />}<br />//---<br />


et dans chaque fonction de calc?.m j'ai mis un NSLog();

La fonction qui l'appelle:

- (IBAction)numeric: (id)sender<br />{<br />&nbsp; &nbsp; NSLog(@&quot;NUMERIC CLICK&quot;);<br />&nbsp; &nbsp; [calculator test];<br />&nbsp; &nbsp; [calculator handleNumber:[[sender title] floatValue]];<br />&nbsp; &nbsp; [displayField setFloatValue:[calculator getValueOfCurrentEditingBuffer]];<br />}<br />

Réponses

  • elfelf Membre
    16:32 modifié #2
    Au fait c'est en rapport? j'ai ces erreures au log:


    2005-08-09 20:38:23.786 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.794 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.800 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.805 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.813 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.822 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.833 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.838 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.848 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.856 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.861 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.867 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.876 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.947 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.951 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.956 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.959 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.963 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.967 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:23.971 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:24.079 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:24.086 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:24.134 sCalc[4880] CFLog (21): Error loading /Library/Application Support/DivXNetworks/liblame3.92.dylib:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /Library/Application Support/DivXNetworks/liblame3.92.dylib&nbsp; (No such file or directory, errno = 2)<br />)<br />2005-08-09 20:38:24.143 sCalc[4880] CFLog (21): Error loading /System/Library/PrivateFrameworks/LiveType.framework/Versions/A/LiveType:&nbsp; error code 0, error number 2 (dyld: /Users/kenneth/Desktop/Programation/Programmes/Cocoa/sCalc/build/sCalc.app/Contents/MacOS/sCalc can&#39;t open library: /System/Library/PrivateFrameworks/LiveType.framework/Versions/A/LiveType&nbsp; (No such file or directory, errno = 2)<br />)<br />[quote][/quote]
    
  • fouffouf Membre
    16:32 modifié #3
    Pour ton deuxieme pb, c'est qu'il manque des fichiers dans différents dossiers (No such file or directory, errno = 2). Pour qui, pourquoi, je ne sais pas.
  • elfelf Membre
    16:32 modifié #4
    OK ça j'avias deviné mais je me demendais si c'étais la cause...

    Quelqu'un a une idée?
    Je peux passer les source (.pbproj, c'est PB) si vous en avez besoin...
  • ChachaChacha Membre
    16:32 modifié #5
    dans 1123690095:

    OK ça j'avias deviné mais je me demendais si c'étais la cause...

    Ton Calculator, ce ne serait pas une IBOutlet que tu aurais déconnectée par erreur ?
    Quand t'as un problème comme ça, fais un NSLog("Calculator : %@", calculator). Au moins tu verras si ça vaut pas nil... Ou alors utilise le débuggueur.
  • elfelf Membre
    16:32 modifié #6
    Euh c'est pas une class IB. et pas un outlet... c'étais au début mais j'ai changé ça buggais trop...

    Je vais tester ta méthode et je re.
  • elfelf Membre
    16:32 modifié #7
    Tu as oublié le @ ce qui m'a valu un parse error lol...

    SInon:


    2005-08-10 20:52:09.800 sCalc[5469] Calculator : (null)


    AU moins le problème est situé...

    Mais je l'ai bien déclarré et je n'ai pas oublié le @class et le #import...
  • ChachaChacha Membre
    16:32 modifié #8
    [quote author=SeoxyS link=topic=1095.msg12026#msg12026

    2005-08-10 20:52:09.800 sCalc[5469] Calculator : (null)


    AU moins le problème est situé...
    Mais je l'ai bien déclarré et je n'ai pas oublié le @class et le #import...

    Ben oui mais déclarer la variable ne suffit pas, faut créer l'objet aussi, avec des alloc et des init.
  • elfelf Membre
    16:32 modifié #9
    Je vais voir de ce côté.

    Merci je re quand j'ai plus d'info...
  • elfelf Membre
    16:32 modifié #10
    Voilà  ça marche merci bien!
Connectez-vous ou Inscrivez-vous pour répondre.