Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding SPView to an existing iOS project shows pink screen (Sparrow Framework)
    primarykey
    data
    text
    <p>I am trying to add some particle effects to my iPhone application. My project is created using traditional UIKit. I am not using the AppScaffold template, so I have to add and setup sparrow manually. I did <code>#import "Sparrow.h"</code>, and it built just fine.</p> <p>The problem is when I tried to add a SPView. It just show a blank pink view. I don't know what I did wrong. Here is my code snippet:</p> <p>Game.h</p> <pre><code>@implementation Game - (id)initWithWidth:(float)width height:(float)height { if (self = [super initWithWidth:width height:height]) { SPQuad *quad = [SPQuad quadWithWidth:100 height:100]; quad.color = 0xff0000; quad.x = 50; quad.y = 50; [self addChild:quad]; } return self; } @end </code></pre> <p>In a viewController's viewDidload...</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; // sparrow SP_CREATE_POOL(pool); [SPStage setSupportHighResolutions:YES]; SPView *spv = [[SPView alloc] initWithFrame:self.view.bounds]; [self.view addSubview:spv]; [spv release]; spv.frameRate = 30; Game *game = [[Game alloc] init]; spv.stage = game; [game release]; [spv start]; SP_RELEASE_POOL(pool); } </code></pre> <p>Additional weird symptoms are that I have created a UIView in .xib file and changed it class to SPView. But when I use that view, the compiler still recognize it as a UIView. It's like xCode can see the header file but the compiler somehow doesn't. Another issue is I tried to use a method 'SPImage *background = [SPImage imageWithContentsOfFile:@"camera_test.png"];', but when I run it, it gives this error <code>reason: '+[NSBundle appBundle]: unrecognized selector sent to class 0x7a6890'.</code> Which means that it cannot find the sparrow category method 'appBundle'. But this method does EXIST in the source code! and it compile with no problem. It just crash at run time.</p> <p>I double checked the build settings and I think I have everything setup correctly, such as 'Other linker flags' as <code>-ObjC -load_all</code>. I have no idea what's the problem.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload