It’s quite easy if you know where to start. There are two ways, you can use UILabel or NSString. With UILabel you can control width and height of rendered texture, also you have words wrap and text aligning.

So step by step:
1. first we need our UILabel, in CGRectMake we are setting our text size (rectangle)
2. then we need our text to display, also font using UIFont class
3. setting text color is also easy, but then comes little trick – you can use “clearColor” with background to make it transparent
4. next thing is to start new image context with UIGraphicsBeginImageContext
5. next 2 line are important if you don’t want your text to be vertically flipped (third parameter in CGContextTranslateCTM is our UILabel height)
6. then we need to render our label using renderInContext
7. and finally we have ready to use texture using UIImage

From time to time previously serialized array will get broken. The most common problem occurs when string length is invalid so instead of

you have

becouse someone edited something directly in db, in this case to make php unserialize() function to work again, just do this magic:

and you will get all strings lenths to be fixed again.

Well, this one can be really painful. But solution is simple, just make sure you are stopping every OpenGL AND sound activity in applicationWillResignActive function, not in applicationDidEnterBackground (becouse it’s too late, app is already in background and no OpenGL/Sound is allowed, you can add playing sounds in background into plist but OpenGL won’t be allowed anyway).

It seems to be trivial, but it’s not. If you want to use custom table and custom model, and sort collection by one of your table’s column, you can’t just use addAttributeToSort as you do with native Magento collection (like “catalog/product”). Instead of this, you should use setOrder, so your code should look like this:

 

Well, that is pretty simple but in case someone will need this, just:

 

In case someone will need this, it’s quite simple:

 

Preparing such export is quite easy, so let’s begin with adding new button in products listing:

in app/code/core/Mage/Adminhtml/Block/Catalog/Product.php in _prepareLayout() function add such code:

then in app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php add new function:

and thats all. You will get new button with export ability.

Today I had to change Magento default products list sorting to sort by product’s date. In fact we don’t need to sort by date, just by entity_id which is product ID in Magento world. To accomplish this, we need to edit /app/code/core/Mage/Catalog/Block/Product/List.php

You have to find _beforeToHtml() function and change some things inside. First we need to define all available sorting options:

then remove all getters of default sorting and order, and put those:

so finally your _beforeToHtml() should looks like this one: