iOS 7 Error

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Kontext:
    Ich habe eine UIView innerhalb einer TableView, worin ich etwas zeichne. Diese UIView hat eine 'Custom Class' in der ich in der drawRect Methode eine weitere Methode aufrufe, in der dieser Code steht.

    Quellcode

    1. - (UIBezierPath*)bezierPathWithStartAngle:(float)startAngle endAngle:(float)endAngle {
    2. CGPoint center = CGPointMake(self.frame.size.width / 2.0, self.frame.size.height / 2.0);
    3. UIBezierPath *path = [UIBezierPath bezierPath];
    4. [path addArcWithCenter:center radius:50 startAngle:startAngle endAngle:endAngle clockwise:YES];
    5. [[UIColor grayColor] setStroke];
    6. [path setLineWidth:lineWidth];
    7. [path stroke];
    8. return path;
    9. }


    Soweit so gut (noch kein Console Log). Wenn ich nun von dem TableViewController die oben genannte Methode aufrufe, bekomme ich den unten stehenden Log.
    Bei der Zeile [[UIColor grayColor] setStroke]; kommt einmal die erste Spalte vom Console Log und er Rest bei dieser Zeile [path stroke];
    Das Komische ist nämlich, das dies nur beim Aufrufen außerhalb der UIView drawRect Methode passiert. Nun meine Frage.. hat irgendwer schon ein ähnliches Problem vorgefunden bzw. mache ich in meinem Code etwas falsch?
    Ich bedanke mich schon mal im Voraus für jegliche Hilfe.

    Hier der Console Log:
    Sep 4 21:56:34 Markuss-MacBook-Pro.local itn-stats[5755] <Error>: CGContextSetStrokeColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

    Sep 4 21:56:34 Markuss-MacBook-Pro.local itn-stats[5755] <Error>: CGContextSaveGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

    Sep 4 21:56:34 Markuss-MacBook-Pro.local itn-stats[5755] <Error>: CGContextSetLineWidth: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

    Sep 4 21:56:34 Markuss-MacBook-Pro.local itn-stats[5755] <Error>: CGContextSetLineJoin: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

    Sep 4 21:56:34 Markuss-MacBook-Pro.local itn-stats[5755] <Error>: CGContextSetLineCap: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

    Sep 4 21:56:34 Markuss-MacBook-Pro.local itn-stats[5755] <Error>: CGContextSetMiterLimit: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

    Sep 4 21:56:34 Markuss-MacBook-Pro.local itn-stats[5755] <Error>: CGContextSetFlatness: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

    Sep 4 21:56:34 Markuss-MacBook-Pro.local itn-stats[5755] <Error>: CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

    Sep 4 21:56:34 Markuss-MacBook-Pro.local itn-stats[5755] <Error>: CGContextDrawPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

    Sep 4 21:56:34 Markuss-MacBook-Pro.local itn-stats[5755] <Error>: CGContextRestoreGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
  • Zeichenfunktionen funktionieren nur innerhalb eines drawRect: Aufrufes oder mit einem Graphics Context welcher expliziert erzeugt wird, also z.B. nach einem UIGraphicsBeginImageContext()

    Die o.a. Methode bezierPathWithStartAngle:endAngle: darfst Du also nur innerhalb der drawRect: Methode aufrufen!
  • MCDan schrieb:

    Zeichenfunktionen funktionieren nur innerhalb eines drawRect: Aufrufes oder mit einem Graphics Context welcher expliziert erzeugt wird, also z.B. nach einem UIGraphicsBeginImageContext()

    Die o.a. Methode bezierPathWithStartAngle:endAngle: darfst Du also nur innerhalb der drawRect: Methode aufrufen!

    Ok, danke für deine Antwort. Wie löse ich es, wenn z. B. auf einem Button Klick, das ganze neu gezeichnet werden soll? Muss ich die drawRect Methode wieder aufrufen oder wie löse ich das?