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

  • Home
  • SEARCH
  • 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 8238371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:47:29+00:00 2026-06-07T19:47:29+00:00

I have 3 classes in my project : HeliController, FlightView and ConnectionView. HeliController stores

  • 0

I have 3 classes in my project : HeliController, FlightView and ConnectionView.
HeliController stores some connection data which is to be used by both FlightView and ConnectionView.

In both ConnectionView and HeliController I have

// Interface
#import "HeliController.h"
@property (retain) HeliController *heliController;

// Implementation
@synthesize HeliController = _HeliController

The ConnectionView takes care of all connection methods, so this class receives the peripheral I am communication with. From here, I send the peripheral data to be stored in the HeliController (which also is the delegate for the peripheral class):

// ConnectionView.m
self.heliController = [[HeliController alloc] initWithDelegateAndPeripheral:self peripheral:peripheral]; 
// Self will receive callbacks from HeliController and the connected peripheral is stored in the HeliController

// HeliController.m:
- (id)initWithDelegateAndPeripheral:(id<HeliControllerDelegate>)delegate peripheral:(CBPeripheral *)peripheral{

if([super init]){
    self.peripheral = peripheral;
    self.peripheral.delegate = self;
}
return self;

}

Now I can reach the peripheral from ConnectionView with

self.heliController.peripheral

and see that both have addresses on stack:

_heliController HeliController *    0x0017f9e0
_peripheral CBPeripheral *  0x0017e570

From FlightView I also want to reach the peripheral data. I do

self.heliController = [[HeliController alloc] init];

and see in the debugger that self.heliController gets an address on stack

_heliController HeliController *    0x0018ac60

but the peripheral is nil

_peripheral CBPeripheral *  0x00000000

why is this? What am I forgetting? This problem occured when I had to restructure my application, and I can’t figure out what I have done wrong.

  • 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-07T19:47:30+00:00Added an answer on June 7, 2026 at 7:47 pm

    My sollution was to send the heliController object to the FlightView when I changed between the views like this:

    - (IBAction)changeViewToFlight:(id)sender {
    
    FlightView *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"FlightViewIdentifier"];
    
    // Make sure the heliController object is passed on to the FlightView
    vc.heliController = self.heliController;
    
    [self.navigationController pushViewController:vc animated:YES];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some classes in my current project which have the wrong package declaration
I'm working on a large project (for me) which will have many classes and
I have a project which it's domain contain following classes: Courier Customer Food Order
i have an android project which has a lot of classes I've built. i
In an ASP.NET Dynamic Data web site/project, all the templates have CSS classes like
I have many classes with static final fields which are used as default values
In my current project, I have classes which are modeled like the following. At
I have my project classes organized in multiple src folders, which have been working
I have several classes in a project which need to only be in certain
I have a project which requires creating Classes dynamically at runtime, where the only

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.