• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSInvocationOperation problem with a signal exc_bad_access
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSInvocationOperation problem with a signal exc_bad_access


  • Subject: NSInvocationOperation problem with a signal exc_bad_access
  • From: ico <email@hidden>
  • Date: Tue, 21 Sep 2010 00:06:40 +0800

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 (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSInvocationOperation problem with a signal exc_bad_access
      • From: Ken Thomases <email@hidden>
    • Re: NSInvocationOperation problem with a signal exc_bad_access
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Accessing NSDistantObject from different threads concurrently
  • Next by Date: Re: NSInvocationOperation problem with a signal exc_bad_access
  • Previous by thread: Re: Accessing NSDistantObject from different threads concurrently
  • Next by thread: Re: NSInvocationOperation problem with a signal exc_bad_access
  • Index(es):
    • Date
    • Thread