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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:29:20+00:00 2026-05-30T14:29:20+00:00

I have a resource which is fetched from a JSON API. The JSON is

  • 0

I have a resource which is fetched from a JSON API.
The JSON is parsed into a NSDictionary which, in this case is called game.

I’m creating a new instance of my Game class based on the attributes from the JSON.

Game class has a property called userRegistered which is defined as follows:

// in Game.h
@interface
@property (nonatomic, assign) BOOL userRegistered;


// elsewhere in my code I have
Game *newGame = [[Game alloc] init];
newGame.userRegistered = ([game objectForKey:@"user_registered"] > 0);

The “user_registered” key in the dictionary will always be either 1 or 0.

Xcode warns me the I have –
warning: Semantic Issue: Incompatible integer to pointer conversion passing 'int' to parameter of type 'BOOL *' (aka 'signed char *')

Can someone please explain the issue and how I might resolve it?

Update

My full game class is defined as follows:

#import <Foundation/Foundation.h>

@interface Game : NSObject

@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *photoURL;
@property (nonatomic, copy) NSString *gameURL;
@property (nonatomic, assign) BOOL *userRegistered;

@end

// Game.m
#import "Game.h"

@implementation Game

@synthesize name = _name;
@synthesize partnerName = _partnerName;
@synthesize photoURL = _photoURL;
@synthesize gameURL = _gameURL;
@synthesize userRegistered = _userRegistered;

@end

I’m getting the error in one of my ViewControllers in this method

     // api_response.body has just been set to an __NSCFArray containing 
     // NSDictionaries by AFNetworking
     NSDictionary *game;
     Game *newGame;
     for (game in api_response.body){
         newGame = [[Game alloc] init];

         NSLog(@"Creating a new game");
         // set attributes for new game instance
         newGame.name = [game objectForKey:@"name"];
         newGame.photoURL = [game objectForKey:@"photoURL"];
         // user registered is either 0 (false) or 1 (true)
         newGame.userRegistered = [[game objectForKey:@"user_registered"] intValue];

         // add the game instance to the appropriate array
         [self addGameToGamesArray:newGame];
         newGame = nil;
     }

The warning shows over newGame.userRegistered = [[game objectForKey:@"user_registered"] intValue];

  • 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-30T14:29:22+00:00Added an answer on May 30, 2026 at 2:29 pm

    I was able to solve this issue by simply using boolValue

    game.userRegistered = [[json objectForKey:@"user_registered"] boolValue];
    

    Thanks all for the help

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

Sidebar

Related Questions

I have a scenario in which I have REST API which manages a Resource
I have some resource which I'd like to protect from concurrent usage both by
I have simple resource which should return JSON array, but it returns object in
I have this resource file which I need to process, wich packs a set
This is a nub question. I have a resource Project which has_many Feeds .
Say I have a resource (e.g. a filehandle or network socket) which has to
I have a common resource, which I want 1 and only 1 instance of
I have resource bundle with my country characters - how to change them into
The script I used fetched a file from https://www.dropbox.com/browse_plain/ $REMOTEDIR?no_js=true which now returns: HTTP/1.1
I have a resource (velocity template) which I'd like to be able to swap

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.