¡@

Home 

2014/10/15 ¤U¤È 10:04:59

iphone Programming Glossary: cfrangemake

Two colors for UILabel TEXT

http://stackoverflow.com/questions/13579209/two-colors-for-uilabel-text

attrString CFAttributedStringCreateMutable kCFAllocatorDefault 0 CFAttributedStringReplaceString attrString CFRangeMake 0 0 string Note we could have created CFAttributedStringRef which is non mutable then we would have to give all its attributes.. as orange next 20 letters as green next 20 as red last remaining as blue CFAttributedStringSetAttribute attrString CFRangeMake 0 20 kCTForegroundColorAttributeName _orange CFAttributedStringSetAttribute attrString CFRangeMake 20 20 kCTForegroundColorAttributeName.. attrString CFRangeMake 0 20 kCTForegroundColorAttributeName _orange CFAttributedStringSetAttribute attrString CFRangeMake 20 20 kCTForegroundColorAttributeName _green CFAttributedStringSetAttribute attrString CFRangeMake 40 20 kCTForegroundColorAttributeName..

How to get the RGB values for a pixel on an image on the iphone

http://stackoverflow.com/questions/144250/how-to-get-the-rgb-values-for-a-pixel-on-an-image-on-the-iphone

self setPixelBitData malloc CFDataGetLength bitmapData Copy image data into allocated buffer CFDataGetBytes bitmapData CFRangeMake 0 CFDataGetLength bitmapData pixelByteData Cast a pointer to the first element of pixelByteData Essentially what we're doing..

how to sort iphone contact book?

http://stackoverflow.com/questions/2697893/how-to-sort-iphone-contact-book

CFArrayCreateMutableCopy kCFAllocatorDefault CFArrayGetCount people people CFArraySortValues peopleMutable CFRangeMake 0 CFArrayGetCount peopleMutable CFComparatorFunction ABPersonComparePeopleByName void ABPersonGetSortOrdering CFRelease..

CTFramesetterSuggestFrameSizeWithConstraints sometimes returns incorrect size?

http://stackoverflow.com/questions/3374591/ctframesettersuggestframesizewithconstraints-sometimes-returns-incorrect-size

attributedString CGSize tmpSize CTFramesetterSuggestFrameSizeWithConstraints framesetter CFRangeMake 0 0 NULL CGSizeMake self.view.bounds.size.width CGFLOAT_MAX NULL CGSize textBoxSize CGSizeMake int tmpSize.width 1 int tmpSize.height..

Core Text: Render to an Odd Shape

http://stackoverflow.com/questions/3813318/core-text-render-to-an-odd-shape

attrString CFAttributedStringCreateMutable kCFAllocatorDefault 0 CFAttributedStringReplaceString attrString CFRangeMake 0 0 string Create the framesetter with the attributed string. CTFramesetterRef framesetter CTFramesetterCreateWithAttributedString.. Create the frame and draw it into the graphics context CTFrameRef frame CTFramesetterCreateFrame framesetter CFRangeMake 0 0 path NULL Flip the text CGAffineTransform flip CGAffineTransformMake 1.0 0.0 0.0 1.0 0 self.frame.size.height CGContextConcatCTM..

Get truncated text from UILabel

http://stackoverflow.com/questions/6728259/get-truncated-text-from-uilabel

attrString attrString release CFRange fitRange CTFrameSetterSuggestFrameSizeWithConstrains frameSetter CFRangeMake 0 0 NULL CGSizeMake labelWidth labelHeight fitRange CFRelease frameSetter CFIndex numberOfCharactersThatFit fitRange.length..

Memory usage grows with CTFontCreateWithName and CTFramesetterRef

http://stackoverflow.com/questions/8491841/memory-usage-grows-with-ctfontcreatewithname-and-ctframesetterref

0 CFAttributedStringBeginEditing attributedStringRef CFAttributedStringReplaceString attributedStringRef CFRangeMake 0 0 CFStringRef label.text font CTFontCreateWithName CFStringRef label.fontName label.fontHeight NULL retain count of the.. label.fontName label.fontHeight NULL retain count of the font 1 CFAttributedStringSetAttribute attributedStringRef CFRangeMake 0 label.text.length kCTFontAttributeName font CFAttributedStringEndEditing attributedStringRef retain count of the font.. retain count of the font 3 CFRelease attributedStringRef CTFrameRef frame CTFramesetterCreateFrame frameSetter CFRangeMake 0 0 path NULL retain count of the font 5 CFRelease frameSetter retain count of the font 4 CTFrameDraw frame ctx CFRelease..