Quantcast
Channel: cocos2d-x - Cocos Forums
Viewing all articles
Browse latest Browse all 2748

EXC_BAD_ACCESS While Trying to Get Data from List or Vector

$
0
0

Hi, first of all, hadn’t been using C++ for years until recently. What I am trying to do is using a list of objects created from a struct that I created and rendering them inside update function.

My struct is simple as follows;

struct tlEntry{
            cocos2d::Sprite* s;
            int yPos;
        };

Depending on the yPos they got, I want to add the sprite to the viewport. When I try to get the node from the list and try to do following, I get EXC_BAD_ACCESS error;

addChild(entries.front().s);

What am I doing wrong?

4 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 2748

Latest Images

Trending Articles



Latest Images