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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:10:11+00:00 2026-06-14T04:10:11+00:00

I’ve just started with the sparrow framework, and have been following The Big Sparrow

  • 0

I’ve just started with the sparrow framework, and have been following “The Big Sparrow Tutorial” by Gamua themselves. I’m on the first part of the tutorial, using the AppScaffold 1.3 but when I try to compile my basic code it hangs at the loading screen and gives me a SIGABRT error.

I put an exception breakpoint, and it stopped here, in GameController.m (seen at bottom) of the AppScaffold:

mGame = [[Game alloc] initWithWidth:gameWidth height:gameHeight];

This was also my only output:

2012-07-30 07:19:54.787 AppScaffold[1682:10a03] -[Game initWithWidth:height:]: unrecognized selector sent to instance 0x7553980
(lldb)

I am using the stock AppScaffold, the only thing I changed was the Game.m.

This is my Game.m:

@interface Game : SPSprite
@end

@implementation Game
{
@private
    SPImage *mBackground;
    SPImage *mBasket;
    NSMutableArray *mEggs;
}

- (id)init
{
    if((self = [super init]))
    {
        //load the background image first, add it to the display tree
        //and keep it for later use
        mBackground = [[SPImage alloc] initWithContentsOfFile:@"background.png"];
        [self addChild:mBackground];

        //load the image of the basket, add it to the display tree
        //and keep it for later use
        mBasket = [[SPImage alloc] initWithContentsOfFile:@"basket.png"];
        [self addChild:mBasket];

        //create a list that will hold the eggs,
        //which we will add and remove repeatedly during the game
        mEggs = [[NSMutableArray alloc] init];
    }
    return self;
}

- (void)dealloc
{
    [mBackground release];
    [mBasket release];
    [mEggs release];
    [super dealloc];
}

@end

I’ve tried my best to use my basic troubleshooting tactics, but I’m very new to Obj-C and Sparrow and could use a hand 🙂

Thanks

EDIT: I’ve addded the GameController.m contents here for clarity:

//
//  GameController.m
//  AppScaffold
//

#import <OpenGLES/ES1/gl.h>
#import "GameController.h"


@interface GameController ()

- (UIInterfaceOrientation)initialInterfaceOrientation;

@end


@implementation GameController

- (id)initWithWidth:(float)width height:(float)height
{
    if ((self = [super initWithWidth:width height:height]))
    {
        float gameWidth  = width;
        float gameHeight = height;

        // if we start up in landscape mode, width and height are swapped.
        UIInterfaceOrientation orientation = [self initialInterfaceOrientation];
        if (UIInterfaceOrientationIsLandscape(orientation)) SP_SWAP(gameWidth, gameHeight, float);

        mGame = [[Game alloc] initWithWidth:gameWidth height:gameHeight];

        mGame.pivotX = gameWidth  / 2;
        mGame.pivotY = gameHeight / 2;

        mGame.x = width  / 2;
        mGame.y = height / 2;

        [self rotateToInterfaceOrientation:orientation animationTime:0];
        [self addChild:mGame];
    }

    return self;
}

- (void)dealloc
{
    [mGame release];
    [super dealloc];
}

- (UIInterfaceOrientation)initialInterfaceOrientation
{
    // In an iPhone app, the 'statusBarOrientation' has the correct value on Startup; 
    // unfortunately, that's not the case for an iPad app (for whatever reason). Thus, we read the
    // value from the app's plist file.

    NSDictionary *bundleInfo = [[NSBundle mainBundle] infoDictionary];
    NSString *initialOrientation = [bundleInfo objectForKey:@"UIInterfaceOrientation"];
    if (initialOrientation)
    {
        if ([initialOrientation isEqualToString:@"UIInterfaceOrientationPortrait"])
            return UIInterfaceOrientationPortrait;
        else if ([initialOrientation isEqualToString:@"UIInterfaceOrientationPortraitUpsideDown"])
            return UIInterfaceOrientationPortraitUpsideDown;
        else if ([initialOrientation isEqualToString:@"UIInterfaceOrientationLandscapeLeft"])
            return UIInterfaceOrientationLandscapeLeft;
        else
            return UIInterfaceOrientationLandscapeRight;
    }
    else 
    {
        return [[UIApplication sharedApplication] statusBarOrientation];
    }
}

- (void)rotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
                       animationTime:(double)animationTime
{
    float angles[] = {0.0f, 0.0f, -PI, PI_HALF, -PI_HALF};

    float oldAngle = mGame.rotation;
    float newAngle = angles[(int)interfaceOrientation];

    // make sure that rotation is always carried out via the minimal angle
    while (oldAngle - newAngle >  PI) newAngle += TWO_PI;
    while (oldAngle - newAngle < -PI) newAngle -= TWO_PI;

    // rotate game
    if (animationTime)
    {
        SPTween *tween = [SPTween tweenWithTarget:mGame time:animationTime
                                       transition:SP_TRANSITION_EASE_IN_OUT];
        [tween animateProperty:@"rotation" targetValue:newAngle];
        [[SPStage mainStage].juggler removeObjectsWithTarget:mGame];
        [[SPStage mainStage].juggler addObject:tween];
    }
    else 
    {
        mGame.rotation = newAngle;
    }

    // inform all display objects about the new game size
    BOOL isPortrait = UIInterfaceOrientationIsPortrait(interfaceOrientation);
    float newWidth  = isPortrait ? MIN(mGame.gameWidth, mGame.gameHeight) : 
                                   MAX(mGame.gameWidth, mGame.gameHeight);
    float newHeight = isPortrait ? MAX(mGame.gameWidth, mGame.gameHeight) :
                                   MIN(mGame.gameWidth, mGame.gameHeight);

    if (newWidth != mGame.gameWidth)
    {
        mGame.gameWidth  = newWidth;
        mGame.gameHeight = newHeight;

        SPEvent *resizeEvent = [[SPResizeEvent alloc] initWithType:SP_EVENT_TYPE_RESIZE
                                width:newWidth height:newHeight animationTime:animationTime];
        [mGame broadcastEvent:resizeEvent];
        [resizeEvent release];
    }
}

// Enable this method for the simplest possible universal app support: it will display a black
// border around the iPhone (640x960) game when it is started on the iPad (768x1024); no need to 
// modify any coordinates. 
/*
- (void)render:(SPRenderSupport *)support
{
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    {
        glEnable(GL_SCISSOR_TEST);
        glScissor(64, 32, 640, 960);
        [super render:support];
        glDisable(GL_SCISSOR_TEST);
    }
    else 
        [super render:support];
}
*/

@end

Here is my Xcode project: http://cl.ly/2e3g02260N47

  • 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-14T04:10:12+00:00Added an answer on June 14, 2026 at 4:10 am

    The tutorial was very old and was incompatible with the latest scaffold;

    I did this:

    - (id)init
    {
        if((self = [super init]))
        {
    

    when I should’ve done this:

    - (id)initWithWidth:(float)width height:(float)height
    {
        if ((self = [super initWithWidth:width height:height]))
        {
    

    thanks, though sergio!

    (There are much better sparrow tutorials and I’m even making my own video tutorials :P)

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I have an array which has BIG numbers and small numbers in it. I
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.