Get file size using NSFileManager

To get file size in bytes using NSFileManager do the following:

UITextField edge insets

To change edge insets in UITextField, create a new subclass and override these methods:

Here 0 is dx, 10 is dy.

Found this nice solution here

How to make UITextField in UITableView become first responder

I loadView create a UITextField ivar.

In ViewDidAppear make it first responder:

In cellForRow add it as a subview:

Отлавливание Shake событий на iOS

Взять любое кастмное View на данном экране. Добавить в его коде:

При загрузке данного View Controller и инциализации данного View делать следующее:

Добавить следующий метод в данном View Controller.


performSelector may cause a leak because its selector is unknown

This is very popular question in StackOverflow.

However, the best answer for XCode 4.6 is this:
“In your project Build Settings, under Other Warning Flags (WARNING_CFLAGS), add

Now just make sure that the selector you are calling does not cause your object to be retained or copied.”

“Note you can add the same flag for specific files rather than the entire project. If you look under Build Phases->Compile Sources, you can set per file Compiler Flags (just like you want to do for excluding files from ARC). In my project just one file should use selectors this way, so I just excluded it and left the others.”

Code snippet: