CALLING OBJECTIVE-C METHOD FROM CUSTOM C FUNCTION

Ankita Pandey

Total Post:183

Points:1285
Posted by  Ankita Pandey
 483  View(s)
Ratings:
Rate this:

I have created an app using MVC like architecture in our GUI app. Model class has some C functions. In C funtions class having some methods of Obj-C class, now I calling those methods using an object of that class.

when I call those methods it will not be executed and also I am not getting any errors.

So my problem is that I am not figure out what exactly is happening.
Is anyone have ideas, to what might be the reason for this?

  1. Ankita Pandey

    Post:183

    Points:1285
    Re: Calling objective-c method from custom C function

    The question I have asked, I found a solution to run objective-c method through C functions. If anyone have its better solution then please tell me:
    Here is my solution:

    void * refToSelf;
    int callBack()
    {
      [refToSelf customMethod:customArg];
    }


    @implementation CustomClass
    -(id) init
    {
      self = [super init];
      refToSelf = self;
    }
    -(void) customMethod:(int)customArg
    {
    }

      Modified On Dec-19-2015 01:25:47 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!