English 中文(简体)
如何减少 OHA 归属标签和绘图文本矩形的内存用量
原标题:how to reduce memory usage of OHAttributedLabel and drawTextInRect

我在自定义的 UITViewCell 中使用OHATFlatedLabel, 我尝试了对应用程序进行剖析分析, 似乎应用程序像正常一样使用内存。 以下是我发现的情况:

""https://i.stack.imgur.com/USXZ3.png" alt="在这里输入图像描述"/ >

Any ideas on how to reduce this memory consumption? Also in the library it has a method on to calculate the height of the text, but for some reason it is one of the heaviest stack trace based on instruments:

""https://i.stack.imgur.com/mQNUa.png" alt="在这里输入图像描述"/ >

问题回答

我猜这仅仅是因为正在创建他的绘图 Contenxt, 试图缩小标签大小, 你应该看到较低的内存, 无论如何在绘图操作后, 上下文应该释放出来, 并成为整层内存的一部分。 我的意思是, 在构建表格视图后, 整个应用程序的内存分配是什么?





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签