sorry guys, question
have code here:
code:
//add text nsstring *text = @"you getting sleepy."; //get font draw in uifont *font = [uifont boldsystemfontofsize:28]; //where going draw it? cgrect textrect; [b]textrect.size = [text sizewithfont:font]; //confusion here[/b] textrect.origin.x = center.x - textrect.size.width * 0.5; textrect.origin.y = center.y - textrect.size.height * 0.5; //set fill color of current context black [[uicolor blackcolor] setfill]; //set shadow offset 4 points right, 3 points down //and dark grey blur radius of 2 points cgsize offset = cgsizemake(4, 3); cgcolorref color = [[uicolor darkgraycolor] cgcolor]; cgcontextsetshadowwithcolor(context, offset, 2.0, color); //draw string [b] [text drawinrect:textrect withfont:font]; //confusion here[/b] }
the parts in bold confused on. neither "sizewithfont" or "drawinrect" methods of nsstring how able call these on nsstring object?
both methods of type cgsize, , found defined in uistringdrawing.h file part of uikit can't understand link between them or how able call these methods on nsstring objects.
there kind of exception because code within overridden drawrect function of uiview subclass can call these methods on strings?
i've been digging around documentation awhile , haven't found answer yet :/
sizewithfont: nsstring method under uikit. makes think isn't? make sure looking @ ios documentation , not mac docs.
Forums iPhone, iPad, and iPod Touch iOS Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
No comments:
Post a Comment