Showing posts with label NSNotificationCenter. Show all posts
Showing posts with label NSNotificationCenter. Show all posts

Friday, April 8, 2011

Autoreleased with No Pool in Place - Just Leaking

When you perform an operation in another thread, place EVERYTHING inside your thread specific autorelease pool. That includes writing debug messages in log as well as sending notifications. Otherwise you will leak memory.

Thursday, April 7, 2011

How to Reset MPMoviePlayer Timeline

When you stream a video (HTTP Live Streaming) over network till finish, the timeline might show there's still a few seconds missing. The problem is that the initial video duration is an estimation, not the exact video length.

There is a system callback, which is called when real video duration is known:

Monday, March 14, 2011

How to Copy Current Toolbar to Next NavigationController

Your application is based on idea of lists, where you can navigate deeper into sublists and then back again. There is a common set of actions, which you want to launch from toolbar at the bottom of each screen.

Sounds easy, except you need to define the toolbar separately for each UIViewController while navigating deeper into lists. That should be easier, right? Try this: