Sprite class hilfe

  • Sprite class hilfe

    Hallo mein objektiv c Buch ist angekommen und ich habe mir auch noch dabei die neue Ix developer gekauft da ist ein Beispiel wo sie sagen das sie weder das Storyboard noch den Interface Builderbenutzen benutzen werden sie sagen sie erstellen stattdessen eine rudimentäre Sprite-Klasse erstellen.
    Da ich mich noch nicht lange mit Objektiv c beschäftige weis ich nicht wie ich so eine erstellen kann.Kann mir da jemand bitte helfen?
  • aja srry ok aber habe jetzt ein neues problem er meldet hier ein Fehler


    Sprite.m

    Quellcode

    1. - (CGPoint) position {return CGpointMake(pic.frame.origin.x,pic.frame.origin.y);}
    2. - (double) width {return width;}
    3. - (double) height {return height;}
    4. - (double) scale {return scale;}
    5. - (CGRect) frame {return CGRectMake(pic.frame.origin.x,pic.frame.origin.y, width*scale, height*scale);}
    6. - (id)initWithFrame:(CGRect)frame
    7. {
    8. self = [super initWithFrame:frame];
    9. if (self) {
    10. // Initialization code
    11. }
    12. return self;
    13. }
    Alles anzeigen



    dann steht da bei der 1. code Zeile Returning 'int' from a Funktion with incomtable result type 'CGPoint(aka'struct CGPoint')
    und noch eine Meldung : Implicit Deklaration of Funktion 'CGpointMake' ist invalid in C99