---
title: "Calling objective-c method from custom C function"  
description: "Calling objective-c method from custom C function"  
author: "Anonymous User"  
published: 2015-12-17  
updated: 2015-12-18  
canonical: https://www.mindstick.com/forum/33750/calling-objective-c-method-from-custom-c-function  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# Calling objective-c method from custom C function

I have created an app using MVC like [architecture](https://www.mindstick.com/articles/249193/top-5-reasons-to-pursue-architecture) in our GUI app. [Model class](https://www.mindstick.com/forum/160267/what-is-the-role-of-the-range-data-annotation-and-when-to-use-it-in-a-model-class) has some C functions. In C funtions class having some [methods](https://www.mindstick.com/articles/13060/runny-nose-remedy-methods-that-work-best) 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](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is that I am not [figure](https://yourviews.mindstick.com/view/87536/what-are-ghosts-jobs-and-how-to-figure-out-them) out what [exactly is happening](https://www.mindstick.com/forum/33966/what-exactly-is-happening-when-we-make-a-field-a-primary-key).\
Is [anyone](https://www.mindstick.com/articles/23207/how-to-find-the-best-fit-job-for-anyone) have [ideas](https://www.mindstick.com/articles/43878/making-the-best-use-of-the-options-trade-ideas), to what might be the reason for this?\

## Replies

### Reply by Anonymous User

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{}
```


---

Original Source: https://www.mindstick.com/forum/33750/calling-objective-c-method-from-custom-c-function

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
