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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:19:57+00:00 2026-05-27T23:19:57+00:00

In my app I am using 3 classes MasterViewController, DeviceViewController, and BRButton. The BRButton

  • 0

In my app I am using 3 classes MasterViewController, DeviceViewController, and BRButton. The BRButton class does all of the real work, and has the hardware delegate callbacks in it for bluetooth 4.0 devices. I am trying to get methods to fire in the other classes when something happens in BRButton. This is working in DeviceViewController, but not in MasterViewController, I’m still pretty green with IOS programing any help is appreciated. Here is some code snippets.
One more thing I should mention is it doesn’t error, it just doesn’t call the method.

BRButton.h

@protocol RefreshScreen
-(void) tableTimer:(NSTimer *)timer;
@end

@protocol BRButtonDelegate 
@optional
-(void) bounceBack;
-(void) tableTimer:(NSTimer *)timer;
@required
-(void) buttonReady;
@end

@interface BRButton : NSObject <CBCentralManagerDelegate, CBPeripheralDelegate> {
    NSTimer *myTimer;
}

@property (nonatomic,assign) id <BRButtonDelegate> delegate;
@property (nonatomic,assign) id <RefreshScreen> testCall;

BRButton.m (here is 2 different places I call something in a different class. First one doesn’t work the second does.)

- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI {
    ...does some work then...
        [[self testCall] tableTimer:nil];  //tableTimer is nil here because no NStimer is used to trigger from this delegate method. 
        printf("New UUID, adding\r\n");

    printf("didDiscoverPeripheral\r\n");
}


- (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error {
    printf("Disconnecting \r\n");
    [[self delegate] bounceBack];
}

MasterViewController.h

@interface MasterViewController : UIViewController < UITableViewDelegate, UITableViewDataSource, RefreshScreen> {
    BRButton *b; 
}

MasterViewController.m (I would expect this to be called after my break point on didDiscoverPeripheral, but it never is.)

-(void) tableTimer:(NSTimer *)timer {
    if(b.peripherals.count > 0)
    {
        [self.deviceTableView reloadData];
    }
}

DeviceViewController.h

@interface DeviceViewController : UIViewController <BRButtonDelegate> {
}
@property (strong, nonatomic) BRButton *bb;

DeviceViewController.m

- (void) bounceBack {
    [self.navigationController popViewControllerAnimated:YES];
}

If you need anymore information let me know.

  • 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-27T23:19:57+00:00Added an answer on May 27, 2026 at 11:19 pm

    Use a breakpoint and make sure the “testCall” property isn’t nil when you call tableTimer on it.

    Also, you should make testCall and delegate weak instead of assign in case those objects get dealloc’d.

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

Sidebar

Related Questions

I have a silverlight app using Prism practices; the current code does a search
I have a web app, that also has an iPhone and Android app using
I'm localizing my iPad/iPhone app by using genstrings Classes/*.m to generate the Localizable.strings file.
I'm using custom classes for my CoreData stack. Class properties are set properly in
I'm writing an app using asp.net-mvc deploying to iis6. I'm using forms authentication. Usually
I have an app using PHP and the PayPal API. The basic way it
I'm making an App using Adobe Flex/Air. I was wondering if there is any
I have an app using a ListView as a main screen. Each row displays
I have an iPhone app using a UINavigationController. On the fourth controller of the
I have an app using SQLite3. It's running pretty well, but I would like

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.