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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:27:19+00:00 2026-06-03T14:27:19+00:00

Possible Duplicate: Send NSString via Game Center i have been working on this for

  • 0

Possible Duplicate:
Send NSString via Game Center

i have been working on this for two days now and not been getting anywhere, i was hoping someone could shed some light on the problem.

1) i have an NSMUtableArray
2) each element within the array is serialised through [encoder encodeObject: myArray]; and the result is returned and assigned to a struct “MessageMove” called “cards” (of type NSData *)
MessageMove message;

….

typedef struct
{
    Message message;
    NSData  *cards;
} MessageMove;

3) Now that the cards have been converted to type NSData i now want to do the same for the struct itself, i call

NSData *data = [NSData dataWithBytes:&message length:sizeof(message)];

4) Finally i send the data to the other player as follows

BOOL success = [[GCHelper sharedInstance].match sendDataToAllPlayers:data withDataMode:GKMatchSendDataReliable error:&error];

the trouble lies with the receiving end not getting any of the Cards data at all (MessageMove->cards). This is probably because the NSData * is not being sent remotely but rather only the pointer to it.

Does anyone know how i can send the actual data? I have been scratching my head all day at this problem and don’t know how i can overcome it

many thanks

  • 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-03T14:27:20+00:00Added an answer on June 3, 2026 at 2:27 pm

    Make MessageMove an Objective-C class that conforms to the NSCoding protocol. Then serialise it to an NSData object, and deserialise it on the other end. For more details, see my earlier answer.

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

Sidebar

Related Questions

Possible Duplicate: Possible to send automated email? This question has been asked in multiple
Possible Duplicate: Using jQuery to compare two arrays I have to send the form
Possible Duplicate: How to programmatically send SMS on the iPhone? Does someone have an
Possible Duplicate: sending mail with php & escaping hotmails junk folder I have been
Possible Duplicate: Passing two command parameters using a WPF binding I need that send
Possible Duplicate: How to pass an array via $_GET in php? So I have
Possible Duplicate: Java socket sends some data during connection to server I have two
Possible Duplicate: SMS from web application Sample code to send Mail via php //
Possible Duplicate: SMS from web application Sample code to send Mail via php //
Possible Duplicate: How to send an email? I have some simple winform application. In

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.