Ignoring certificate errors with NSURLConnection

You could simply ignore the invalid certificate if you are not sending any sensitive information. This article describes how you could do that. Here is an example implementation by Alexandre Colucci for one of the methods described in that article. Essentially you want to define a dummy interface just above the @implementation: @interface NSURLRequest (DummyInterface) … Read more

What are the numbers in the square brackets in NSLog() output?

The first number is the process ID, the second is the logging thread’s Mach port. A desktop example: 2010-10-19 17:37:13.189 nc_init[28617:a0f] nc <CFNotificationCenter 0x10010d170 [0x7fff70d96f20]> – default <CFNotificationCenter 0x10010d2a0 [0x7fff70d96f20]> (gdb) i thread Thread 1 has current state “WAITING” Mach port #0xa0f (gdb port #0x4203) frame 0: main () at nc_init.m:10 pthread ID: 0x7fff70ebfc20 system-wide … Read more

Accurate timing in iOS

Ok, I have some answers after doing some more tests, so I am sharing it with anyone who is interested. I’ve placed a variable to measure time intervals between ticks, inside the play method (the method that actually sends the play message to the AVAudioPlayer object), and as my simple compare-to-external-watch experiment showed, the 60 … Read more

Couldn’t UIToolBar be transparent?

To make a completely transparent toolbar, use the method described here. In a nutshell, create a new TransparentToolbar class that inherits from UIToolbar, and use that in place of UIToolbar. TransarentToolbar.h @interface TransparentToolbar : UIToolbar @end TransarentToolbar.m @implementation TransparentToolbar // Override draw rect to avoid // background coloring – (void)drawRect:(CGRect)rect { // do nothing in … Read more

Return a list of running background apps/processes in iOS

Make a sysctl API and retrieve the kinfo_proc structure http://fxr.watson.org/fxr/source/sys/kinfo.h?v=DFBSD. This struct has information about running processes.You can run it in a loop until to get info about all processes. Here is a code snippet- extend it to get info of all processes mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2] = KERN_PROC_ALL; mib[3] = 0; … Read more