Callback methods from C to Objective-C

前端 未结 4 1299
伪装坚强ぢ
伪装坚强ぢ 2021-01-21 07:03

I have an Objective-C class. What I am doing is I am calling C functions in my objective-C class [ This C functions I implemented in one file , which is part in this sample ios

4条回答
  •  广开言路
    2021-01-21 07:09

    First of all Thanks to Ricardo Kloth , Now it's working for me.

    Here is my code ...

    Objective-C Code:

    static id staticObject = nil;
    
    @Implementation MyObjCclass
    
    init
    {
        ....
    
        staticObject = self;
    }
    
    // C fun
    void functionPointer() 
    { 
        [staticObject message]; // it's working 
    }
    
    -(void) message
    {
    
    }
    
    @end
    

提交回复
热议问题