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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:13:06+00:00 2026-06-05T19:13:06+00:00

Ive now identified a problem in a few diff classes in my iPhone Coco2d

  • 0

Ive now identified a problem in a few diff classes in my iPhone Coco2d game, my first Objective-c go. My setters don’t seem to be working! If I try access property after setting it’s either NULL (if to Stringed) or I get a fatal bad access exception, I must be doing something wrong, heres my code:

@interface Character : CCNode 
    {
        CCSprite* sprite;
        int width;
        int height;
    }
    @property (retain) CCSprite* sprite;
    @property int width;
    @property int height;
@end

and implemntation:

@implementation Character

@synthesize sprite;
@synthesize width;
@synthesize height;

-(id) init
{
    if((self=[super init])) {
        [self setSprite :[CCSprite spriteWithFile:@"character.png"]];
        [self setWidth:28];
        [self setHeight:28];
        NSLog(@"About to try get height...");
        NSLog([self height]); //bad access exception
    }
}
  • 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-05T19:13:08+00:00Added an answer on June 5, 2026 at 7:13 pm

    That’s a poorly formatted log statement

    NSLog(@"Height :%d", [self height]);
    

    NSLog looks for a string to print, you’ve given it an int which can’t be changed to an object

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

Sidebar

Related Questions

Ive made an app, and published it now. I'm facing a weird problem where
I am using localtime.js sucessfully on my app but now that ive started to
Ive tried searching for hours now and cannot find out why my code (aka,
Ive been tryin to solve this for a long time and now know why
im really desperate right now, ive tried everything. Everytime i run my app this
So, Ive made Windows Phone app that contains rss-feeds. I would now like to
I'm onto problem 245 now but have hit some problems. I've done some work
Now this is a tricky problem for which I'm not able to figure out
I've never done shell script before and now I'm running into a simple problem...
With the help of one of StackOverflow's I beat one problem, but now I

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.