Note that there are some explanatory texts on larger screens.

plurals
  1. PONSMutableArray wrapped in C++ class
    primarykey
    data
    text
    <p>I'm doing some porting from Qt Cocos2d to iOS cocos2d, am using Objective-C++ as the language for minimal efforts, now I'm wrapping the NSMutableArray in a C++ class for easier porting, basically this is my class</p> <p>QList.h</p> <pre><code>#ifndef QLIST_H #define QLIST_H #import &lt;Foundation/Foundation.h&gt; class QList { NSMutableArray* List; public: QList(); ~QList(); void append(id); id at (int i); int size(); bool isEmpty(); id takeLast(); id last(); void prepend(id); id takeAt(int i); id takeFirst(); void clear(); }; #endif </code></pre> <p>QList.mm</p> <pre><code>#ifndef QLIST_MM #define QLIST_MM #import "QList.h" QList::QList() { List = [[NSMutableArray alloc] init]; } QList::~QList() { [List autorelease]; List = nil; } void QList::append(id object) { [List addObject:object]; } id QList::at(int i) { return [List objectAtIndex:i]; } int QList::size() { return [List count]; } bool QList::isEmpty() { if ([List count] == 0) return true; return false; } id QList::takeLast() { id temp = [List lastObject]; [List removeLastObject]; return temp; } id QList::last() { return [List lastObject]; } void QList::prepend(id object) { [List insertObject:object atIndex:0]; } id QList::takeAt(int i) { id temp = [List objectAtIndex:i]; [List removeObjectAtIndex:i]; return temp; } id QList::takeFirst() { return takeAt(0); } void QList::clear() { [List removeAllObjects]; } #endif </code></pre> <p>I'm recieving EXC_BAD_SIGNAL on this line</p> <pre><code> return [List count]; </code></pre> <p>Could anyone help me, I much appreciate it, thanks in advance :)</p>
    singulars
    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.
 

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