Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8595579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:28:08+00:00 2026-06-12T00:28:08+00:00

My first question is that if I write a class in C++ using opencv

  • 0

My first question is that if I write a class in C++ using opencv library to detect any object in an image and call that c++ class in objective-C (xcode project) then will this technique work?

and

Second question is that how I can add c/c++ class in my iphone app project and use it in my traditional ViewController Class.

What I have done till now is uder

: Created a TabView Application with one ViewController.
: Added a Push Button in that ViewController.
: Added a File.c class which is just printing string.
: Imported “File.c” in my ViewController.h and ViewController.m class like

MY ViewController.h class

#import <UIkit/UIkit.h>
#import "file.c"

MY ViewController.m class

#import "FirstViewController.h"
#import "File.c"

now on action of the push button I want to call that C class that I have already added in the project.
I am hoping to get good and beneficial answers.

Regards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:28:10+00:00Added an answer on June 12, 2026 at 12:28 am

    File.c

    #ifndef testC_File_c
    #define testC_File_c
    #include <stdio.h>
    void say_hello() {
        printf("Hello World!");
    }
    #endif
    

    ViewController.h

    #import <UIKit/UIKit.h>
    
    @interface ViewController : UIViewController
    - (IBAction) buttonDown:(id)sender;
    @end
    

    ViewController.mm

    #import "ViewController.h"
    #include "File.c"
    @interface ViewController ()
    
    @end
    
    @implementation ViewController
    
    - (IBAction) buttonDown:(id)sender
    {
        say_hello();
    }
    - (void)viewDidLoad
    {
        [super viewDidLoad];
    }
    - (void)didReceiveMemoryWarning
    {
        [super didReceiveMemoryWarning];
    }
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've a question about a code i've write to call a procedure using NHibernate,
First, here's my original question that spawned all of this . I'm using Appcelerator
First question here: it is a very short yet fundamental thing in Java that
First question from me; I'm currently fixing a graphing service that uses XSLFO to
That's my first question :) I'm storing the configuration of my program in a
this is my first question here :) I know that I should not check
my first question here! I have a problem with a piece of code that
This is my first question on Stack Overflow, so I hope that I'm clear
It's my first question on SO. I know that there were many topics on
Ok, first question so here goes, A function that runs on activation of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.