Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 26th, 2010  |  syntax: Objective C  |  size: 0.99 KB  |  views: 67  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //This is the Wrapper .h
  2. #import <Foundation/Foundation.h>
  3.  
  4. #ifdef __cplusplus
  5. class RTree; //here I get 'Forward declaration of struct RTree'
  6. //class RTree<void *, double, 2, double>; // With this it says ' RTree is not a template'
  7. #endif
  8.  
  9. @interface NextScenesController : NSObject {
  10.     #ifdef __cplusplus
  11.     RTree<void *, double, 2, double> * rTree; // 'RTree is not a template'
  12.     #endif
  13. }
  14.  
  15. //@property (nonatomic, assign) RTree<void *, double, 2, double> * rTree;
  16. @end
  17.  
  18. //Here is the Wrapper .mm
  19. #import "NextScenesController.h"
  20. #include "RTree.h"
  21.  
  22. @implementation NextScenesController
  23.  
  24. //@synthesize rTree;
  25. @synthesize count;
  26. @synthesize validScenes;
  27.  
  28. - (id)init{
  29.     self = [super init];
  30.     if (self)
  31.     {
  32.         rTree = new RTree<void *, double, 2, double>(); // 'Expected type specifier' of course : D
  33.         count = 0;
  34.     }
  35.     return self;
  36. }
  37. - (void)dealloc{
  38.  
  39.     //rTree->RemoveAll();
  40.     delete(rTree);
  41.     self.validScenes = nil;
  42.     [super dealloc];
  43. }