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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:00:14+00:00 2026-05-27T21:00:14+00:00

I tried out an app to test bluetooth communication. It is a simple app

  • 0

I tried out an app to test bluetooth communication. It is a simple app that just sends a message in text form from one iDevice to another. Originally, this app had about 6 warnings but I fixed all but two. They are the same but deal with different delegates. One is for the GKPeerPickerControllerDelegate and the other for the GKSessionDelegate. Say the Picker error is for the GKPeerPickerController named picker, when you type (more complete example to follow):

picker.delegate = self;

the compiler says:

Passing ‘*const___strong’ to parameter of incompatible type ‘id’.

For the GKSession named session, typing

session.delegate = self;

makes the compiler say:

Sending ‘*const___strong’ to parameter of incompatible type ‘id’.

These only pop in the button to send and peerPickerController. I know that these warnings do not impede on the app’s ability to function but I would like to completely update this for Xcode 4.2. This app was originally written for Xcode back when iOS 3.0 was new. Yes, I am a bit picky when it comes to writing or practicing code, it must not contain any errors/warnings whenever possible.

These are the code blocks where the warning occur:

-(IBAction)btnConnect:(id)sender{
    picker = [[GKPeerPickerController alloc] init];
    picker.delegate = self;  //Warning here
    picker.connectionTypesMask = GKPeerPickerConnectionTypeNearby;

    [connect setHidden:YES];
    [disconnect setHidden:NO];
    [picker show];
}

-(void)peerPickerController:(GKPeerPickerController *)PCpicker didConnectPeer:(NSString *)peerID toSession:(GKSession *)session{
    self.currentSession = session;
    session.delegate = self;  //Warning here
    [session setDataReceiveHandler:self withContext:nil];
    PCpicker.delegate = nil;

    [PCpicker dismiss];
}

Edit:

The header has this:

    @interface BTViewController : UIViewController{
GKSession *currentSession;
IBOutlet UITextField *txtMessage;
IBOutlet UIButton *connect;
IBOutlet UIButton *disconnect;

GKPeerPickerController *picker;

}

  • 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-27T21:00:15+00:00Added an answer on May 27, 2026 at 9:00 pm

    I believe whatever class self is may not be adopting the GKPeerPickerControllerDelegate and GKSessionDelegate formal protocols. Can you post your interface header?

    EDIT

    Casting to id will clear the warnings, but you really didn’t “fix” anything…looking at the class header, it is not adopting the protocols that the delegates are expecting.

    Modify your interface to adopt those protocols:

    @interface BTViewController : UIViewController <GKPeerPickerControllerDelegate, GKSessionDelegate> {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have someone tried out DeCAL in Delphi 2009? I'm thinking about upgrading from 2007,
I have more than one OpenID as I have tried out numerous. As people
I just read Emacs :TODO indicator at left side , and tried it out.
I tried using this How do I test Pony emailing in a Sinatra app,
I want to write a simple P2P test app which uses HTTP as underlying
Earlier today I wrote a small test app for iteratees that composed an iteratee
Please consider the simple express.js route: app.get(/test, function(req, res) { if(condition1) { res.render(foo, {
We're working on an app that streams a large amount of data out via
Hey all, I'm trying to fix up my numerous scenarios that test out pages
I recently co-authored and published a simple app to test the Android waters and

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.