Skip to content

Instantly share code, notes, and snippets.

View sync's full-sized avatar

Anthony Mittaz sync

View GitHub Profile
@sync
sync / gist:957132
Created May 5, 2011 14:26 — forked from AlanQuatermain/gist:957060
Keep your iOS network activity indicator under control, in a *thread-safe* way. Also shows a useful means of debugging it by logging backtraces for on/off calls.
//
// KBNetworkActivityIndicator.h
// Kobov3
//
// Created by Jim Dovey on 10-03-21.
// Copyright 2010 Kobo Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
// This sqlite3_exec limits the database to 50 DB pages (about 1.5Kb each)
// Huge memory win on iPhone.
if(sqlite3_exec(myDatabsae, "PRAGMA CACHE_SIZE=50", NULL, NULL, NULL) != SQLITE_OK)
NSLog(@"Couldn't set cache size: %s", sqlite3_errmsg([self.database sql]));