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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:10:21+00:00 2026-06-09T18:10:21+00:00

In my first file I want to be able to get reference to my

  • 0

In my first file I want to be able to get reference to my second file and change a property that it has, This is what I have. I made a class method to return the reference but the problem is I get a warning in the method, on top of that when I do the if statement it doesnt seem to run.

First File that needs reference, calls class method to get reference

-(void) updateSplitViewDetail{

id detail =  (MapViewController*) [MapViewController returnReference];
NSLog(@"%@", [detail class]); //This post MAPVIEWCONTROLLER

//This fails so I cant access the methods inside.
if ([detail isKindOfClass:[MapViewController class]]) {
    MapViewController *mapVC = (MapViewController*) detail;
    mapVC.delegate = self;
    mapVC.annotations = [self mapAnnotations];
}

}

 (void)viewDidLoad
  {
[super viewDidLoad];    
[self updateSplitViewDetail]; //Error may be here?
  }

Second File that I want reference to, returns reference using self.

- (void)viewDidLoad
{

NSLog(@"%@", [self class]);

[super viewDidLoad];
self.mapView.delegate = self;
// Do any additional setup after loading the view.
}

+(MapViewController*) returnReference{
//I also get an incompatible pointer return warning here?
return self;
}
  • 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-09T18:10:22+00:00Added an answer on June 9, 2026 at 6:10 pm
    +(MapViewController*) returnReference {
        //I also get an incompatible pointer return warning here?
        return self;
    }
    

    You get a warning because this is a class method (see the +) therefore this is of type Class not of type (MapViewController*). It refers to the MapViewController class not to an instance of that class. And the pointer you are returning is the class itself, not an instance. This is why the test fails and you cannot call the instance methods in the other code.

    You probably want to instantiate the class and return the instance instead.

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

Sidebar

Related Questions

I have one binary file and I want to read this file like first
I have two csv file. First File has date offerid clicks orders Second File
I want to use x[#] from first file and x[#] from second file, I
hi guys i have two pipe delimited files,first file contains 1000 records and second
I have a class which get all the bytes from a file, then it
I'm working on my first iPhone app and have been able to get most
I have an app that I want to be able to build two different
First, I don't want to use a database or a local file. Is it
I am processing one binary file in which I want to retrieve first 4
I have 3 files 1) show_createtable.html 2) do_showfielddef.php 3) do_showtble.php 1) First file is

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.