Altro HELP OBJ-C

  • Autore discussione Utente cancellato 187452
  • Data d'inizio
Stato
Discussione chiusa ad ulteriori risposte.
U

Utente cancellato 187452

ho fatto un programmino in obj-c dato che sto iniziando
Codice:
[COLOR=#D12F1B][FONT=Menlo][COLOR=#78492a]#import [/COLOR]<Foundation/Foundation.h>[/FONT][/COLOR]
[FONT=Menlo]
[/FONT]
[FONT=Menlo][COLOR=#bb2ca2]int[/COLOR] main([COLOR=#bb2ca2]int[/COLOR] argc, [COLOR=#bb2ca2]const[/COLOR] [COLOR=#bb2ca2]char[/COLOR] * argv[])[/FONT]
[FONT=Menlo]{[/FONT]
[FONT=Menlo]
[/FONT]
[COLOR=#BB2CA2][FONT=Menlo][COLOR=#000000]    [/COLOR]@autoreleasepool[COLOR=#000000] {[/COLOR][/FONT][/COLOR]
[FONT=Menlo]        [/FONT]
[COLOR=#008400][FONT=Menlo][COLOR=#000000]        [/COLOR]// insert code here...[/FONT][/COLOR]
[FONT=Menlo]        [COLOR=#bb2ca2]int[/COLOR] random, scelta;[/FONT]
[FONT=Menlo]        [COLOR=#bb2ca2]BOOL[/COLOR] continuegame=[COLOR=#bb2ca2]TRUE[/COLOR], keepplay=[COLOR=#bb2ca2]TRUE[/COLOR];[/FONT]
[FONT=Menlo]        [COLOR=#bb2ca2]char[/COLOR] scielta;[/FONT]
[FONT=Menlo]        [COLOR=#bb2ca2]while[/COLOR](keepplay)[/FONT]
[FONT=Menlo]        {[/FONT]
[FONT=Menlo]            random=([COLOR=#3d1d81]arc4random[/COLOR]()%[COLOR=#272ad8]100[/COLOR]+[COLOR=#272ad8]1[/COLOR]);[/FONT]
[FONT=Menlo]            [COLOR=#bb2ca2]while[/COLOR] (continuegame)[/FONT]
[FONT=Menlo]            {[/FONT]
[COLOR=#D12F1B][FONT=Menlo][COLOR=#000000]                [/COLOR][COLOR=#3d1d81]NSLog[/COLOR][COLOR=#000000]([/COLOR]@"scegli un numero tra 1 e 100"[COLOR=#000000]);[/COLOR][/FONT][/COLOR]
[FONT=Menlo]                [COLOR=#3d1d81]scanf[/COLOR]([COLOR=#d12f1b]"%d"[/COLOR],&scelta);[/FONT]
[FONT=Menlo]                [COLOR=#3d1d81]fgetc[/COLOR]([COLOR=#78492a]stdin[/COLOR]);[COLOR=#008400]//rimuove invio ecc[/COLOR][/FONT]
[FONT=Menlo]                [COLOR=#bb2ca2]if[/COLOR] (scelta==random)[/FONT]
[FONT=Menlo]                {[/FONT]
[FONT=Menlo]                    continuegame=[COLOR=#bb2ca2]FALSE[/COLOR];[/FONT]
[FONT=Menlo]                    [COLOR=#3d1d81]NSLog[/COLOR]([COLOR=#d12f1b]@"corretto!"[/COLOR]);[/FONT]
[FONT=Menlo]                }[/FONT]
[FONT=Menlo]                [COLOR=#008400]//nested if[/COLOR][/FONT]
[FONT=Menlo]                [COLOR=#bb2ca2]else[/COLOR] [COLOR=#bb2ca2]if[/COLOR] (scelta>random)[/FONT]
[FONT=Menlo]                    [COLOR=#3d1d81]NSLog[/COLOR]([COLOR=#d12f1b]@"troppo grande"[/COLOR]);[/FONT]
[FONT=Menlo]                [COLOR=#bb2ca2]else[/COLOR][/FONT]
[FONT=Menlo]                    [COLOR=#3d1d81]NSLog[/COLOR]([COLOR=#d12f1b]@"troppo piccolo"[/COLOR]);[/FONT]
[FONT=Menlo]            }[/FONT]
[COLOR=#D12F1B][FONT=Menlo][COLOR=#000000]            [/COLOR][COLOR=#3d1d81]NSLog[/COLOR][COLOR=#000000]([/COLOR]@"giochi ancora?"[COLOR=#000000]);[/COLOR][/FONT][/COLOR]
[FONT=Menlo]            scielta=[COLOR=#3d1d81]fgetc[/COLOR]([COLOR=#78492a]stdin[/COLOR]);[/FONT]
[FONT=Menlo]            [COLOR=#bb2ca2]if[/COLOR] (scielta==[COLOR=#272ad8]'N'[/COLOR]||scielta==[COLOR=#272ad8]'n'[/COLOR])[/FONT]
[FONT=Menlo]            {[/FONT]
[FONT=Menlo]                keepplay=[COLOR=#bb2ca2]FALSE[/COLOR];[/FONT]
[FONT=Menlo]            }[/FONT]
[FONT=Menlo]            continuegame=[COLOR=#bb2ca2]TRUE[/COLOR];[/FONT]
[FONT=Menlo]    }[/FONT]
[FONT=Menlo]    [COLOR=#bb2ca2]return[/COLOR] [COLOR=#272ad8]0[/COLOR];[/FONT]
[FONT=Menlo]    }[/FONT]
[FONT=Menlo]}[/FONT]
il problema non penso sia il codice ma qualcos'altro
qui la descrizione del problema data da XCode:

error: failed to launch '/Users/Cancercookie/Library/Developer/Xcode/DerivedData/chapter3-gtwwdoknwrmvdhfinpmisoyaeszs/Build/Products/Debug/chapter3' -- error: Host::LaunchProcess (launch_info) => pid=0, path='/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver' err = error: ::posix_spawnp ( pid => 44228, path = '/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver', file_actions = 0x11be0f268, attr = 0x11be0f2a0, argv = 0x7ff9ff3f32d0, envp = 0x0 ) err = Bad file descriptor (0x00000009) (0x00000009)error: failed to launch '/Users/Cancercookie/Library/Developer/Xcode/DerivedData/chapter3-gtwwdoknwrmvdhfinpmisoyaeszs/Build/Products/Debug/chapter3' -- error: Host::LaunchProcess (launch_info) => pid=0, path='/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver' err = error: ::posix_spawnp ( pid => 44228, path = '/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver', file_actions = 0x11be0f268, attr = 0x11be0f2a0, argv = 0x7ff9ff3f32d0, envp = 0x0 ) err = Bad file descriptor (0x00000009) (0x00000009)
 
chiudo dato che non risponde nessuno... inoltre il problema sembra essersi fixato da solo.
 
Stato
Discussione chiusa ad ulteriori risposte.