• 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
Circumvent Messaging
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Circumvent Messaging


  • Subject: Circumvent Messaging
  • From: Nicolai <email@hidden>
  • Date: Sun, 7 Oct 2001 00:23:32 +0200

Hi all!

I want to call some of my functions directly without
using the messaging mechanism, like here:

@implementation aClass
{
void (*funcPtr)(int, double*);
}

- (id)init()
{
[super init];

funcPtr = (void (*)(int, double*))[target
methodForSelector:@selector(getData:)];
}

- (void)doSomething
{
int i;
double dReturn;

for ( i = 0; i < 1000; i++)
funcPtr(i, &dReturn);
}

- (void)getData:(int)i storeInto:(double*)pDouble
{
...
*pDouble = d; //EXC_BAD_ACCESS thrown
}

@end

When I want to access a member variable of aClass or a
variable through a pointer from getData which was called
via the function pointer in most cases EXC_BAD_ACCESS is
thrown.
Is there anything special about directly calling a
function?

Regards, Nicolai.


  • Prev by Date: memory and launching
  • Next by Date: Re: Docklet(ing) API & 10.1: Where ????
  • Previous by thread: memory and launching
  • Next by thread: Use one nib file or lots?
  • Index(es):
    • Date
    • Thread