Hi All,

I have a test program which is "command line tool" type when I created the
project.
I also have added a class into this project, called DemoPoint.
My main function showed as follow:

int main (int argc, const char * argv[]) {
   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
   // perform some test codes;

   DemoPoint *dp = [[DemoPoint alloc] init];
   [dp display];
   // so far so good

   // receive signal exc_bad_access when the program execute the next
statment
   NSInvocationOperation *theOp = [[[NSInvocationOperation alloc]
initWithTarget:dp selector:@selector(massiveWork:) object:nil] autorelease];

   [dp release];
   [pool drain];
   return 0;
}

here is the massiveWork method in DemoPoint class:

- (void) massiveWork {

int count = 0;

for (int i = 0; i < 1000; i++) {

count += 2;

}

NSLog(@"massive work done!");

}

can someone tell me what problem is, NSInvocationOperation allocation is
even failed, I guess it maybe a simple problem
but I am just new to Objective-C, so please help, thanks.

-- 
==========================
Life isn't about finding yourself.
Life is about creating yourself.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to