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 597209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:15:20+00:00 2026-05-13T16:15:20+00:00

Im new to Obj-C, and I have a class, with a variable of a

  • 0

Im new to Obj-C, and I have a class, with a variable of a class in it, and I have a function not in a class that I need to call a function of the variable of the first one from, when the first class calls the function. Thats written all wrong, but I dont know the right words so:

Root.h:

@interface Root {
    UITableView *tableview;
}
@property (nonatomic,retain) UITableView *tableview;
@end

I have a function(Root is a delagate, so it gets called, and calls another function, not in any class or anything:

void Search()
{
    //here I need to call a function, I dont know how.  If I was in Root.m, it would be
    //[self.tableview reloadData];

But here I dont know how to call it, ive tried passing Search a pointer to a function in Root.m that calls the function:

-(void) update {
    [self.tableview reloadData];
}
-(void) anotherFunction {
    Search(update);

or

    Search(self.update);

etc
but it always errors there, I also tried passing a pointer (self) to Search, and calling

[pointer.tableview reloadData];

but that errors when I run it:

unrecognized selector sent to instance 0x3detc

How Do I do it?

(sorry if this was very confusing)

  • 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-05-13T16:15:20+00:00Added an answer on May 13, 2026 at 4:15 pm

    So let me get this straight: you have a class Root and an instance of that class myRoot. In the class, there two functions -update and -anotherFunction. You also have a C function search(). When in -anotherFunction, you want to call search() and, from there, call back to -update in the original instance of root.

    If that is all correct, let’s pretend you got into -anotherFunction by calling [myRoot anotherFunction];. We’ll also assume that everything is in the same file or that all files have been #imported or #included correctly.

    You need to define search() as void search(id callback). In -anotherFunction call search() like this: search(self). Then, in search(), you can call [callback update]; to call -update from the class instance where you were originally executing -anotherFunction.

    I think that answers your question. Please don’t hesitate to ask for clarifications.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a app that need manage money datatype. I'm new on Obj-c, so
I have a very simple javascript class that does an ajax call to a
In general, if you have a class that inherits from a Thread class, and
I have a script which creates a user-defined object like this: obj = new
I have a method -(void)myMethod:(MyObject*)obj And I am detaching a new thread [NSThread detachNewThreadSelector:@selector(myMethod)
Is it like... var obj = new Object(); obj.function1 = function(){ //code } or
I have a function runAjax that functions correctly. Unfortunately I am struggling to return
i have a Reply class: class Reply(models.Model): reply_to = models.ForeignKey(New) creator = models.ForeignKey(User) reply
I have got a problem where my class apparently is not being parsed correctly
I have php file with a class in it that needs to read 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.