You are not supposed to call NSApplicationMain thousands of times. You only call it once to initialize the application, load nibs and get a run loop started.
What in the world are you trying to do?
Thanks for the replys.
i was leave some day that is why the late reply,please excuse.
I dont want any infinte loop. i need loop that must iterate foa big value. i used long, unsigned long, int .... insted of unsigned long long but same thing happening.
i run the 'for loop program( written in C,C++) in windows using gcc compiler it works fine.
( i am using mac mini - Machine Name: Mac mini
Machine Model: Macmini1,1
CPU Type: Intel Core Duo
Number Of Cores: 2
CPU Speed: 1.66 GHz
L2 Cache (shared): 2 MB
Memory: 512 MB
Bus Speed: 667 MHz
Boot ROM Version: MM11.0055.B05
)
Actually in my original program 'for loop' have to iterarte more than 50000000( i wrote the program in cocoa -objective c). i tried the program with the value but i didnot get the desired output. then i found the problem was with for loop. then tried the simple program which i already written in forum and i realise the problem(not iteraring more than 714842(may change).
Then i changed the program as shown below
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
unsigned long long i=0;
unsigned int j=0,k=0;
for(;i<=100000;++i)
printf("%llu\n",i);
for(;j<=300000;++j)
printf("%i\n",j);
for(;k<=500000;++k)
printf("%i\n",k);
printf("finished");
//printf("\n%llu",i++);
//printf("\r%llu",i);
return NSApplicationMain(argc, (const char **) argv);
}
the output is like this
first loop iterate foe 100000
second loop iterate for 300000
third loop iterate for only 314278
that is total iteration in program is 714278 !!
then stuck the program and i waited for 1 hour but it not showing any message or error and not terminated.
is it a problem with my system or program. i have no other mac system to check.
with regards and thanks
Nishad