Drawing Bar Chart

Discussion in 'iOS Programming' started by dipaliP, Oct 16, 2008.

  1. dipaliP macrumors newbie

    Joined:
    Oct 6, 2008
    #1
    Hi All
    I want to draw bar chart using Xcode 10.5.
    I am using Cocoa Touch Application for it. I am confused about how to use NSBezier, as the default framework bundle (iPhone OS2.0sdk) does not contain AppKit framework.
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Do you mean NSBezierPath? I cannot find any reference in the documentation to NSBezier. Anyway you can't use any AppKit classes on the iPhone.
     
  3. dipaliP thread starter macrumors newbie

    Joined:
    Oct 6, 2008
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    Have you tried read the documentation? I'm not about to do your research for you.
     
  5. chbeer macrumors member

    chbeer

    Joined:
    Sep 22, 2008
    Location:
    Berlin
    #5
    Maybe a new Forum makes sense: "iPhone Programming for Noobs" or better "iPhone Programming for the lazy ones" or "iPhone Programming Self-Help Group"... There all noobs can ask questions and other noobs may answer them.

    Please stop asking questions like "how do I enter text in the Xcode editor" or "How do I start Xcode"? ... Aaah!!!! :eek:
     
  6. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #6
  7. dipaliP thread starter macrumors newbie

    Joined:
    Oct 6, 2008
    #7
    context variable not initializing.
    As i am drawing it on view i haven't pushed CGContext.
    I think there would be any other way to initialise context variable.

    I am using following statement to initialize.
    CGContextRef context = UIGraphicsGetCurrentContext();
     
  8. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #8
    Are you drawing inside the drawRect method of your view, or drawing to a backing bitmap?

    .
     
  9. dipaliP thread starter macrumors newbie

    Joined:
    Oct 6, 2008
    #9
    I am adding new view in nib file and displaying that view on some event of previous view's control. Its goes fine up to displaying that newly added view but control does not enters into view's drawrect: method.

    When i tried it with default view it displays all lines.
     
  10. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #10
    Did you send a setNeedsDisplay message to the view instance whose drawRect you want called?

    Is that view visible?

    .
     
  11. dipaliP thread starter macrumors newbie

    Joined:
    Oct 6, 2008
    #11
    I am displaying a view on one view.
    When click event occurs on first view i am replacing existing view with another view and i want to draw some lines on newly appeared view.
    i called setNeedsDisplay, but its not reaching there in drawRect method.
     
  12. dipaliP thread starter macrumors newbie

    Joined:
    Oct 6, 2008
    #12
    finally solved

    The code whatever i wrote that was ok, but i didn't check nib file.
    Now its solved........
    Thanks everyone for your help...........
     

Share This Page