How to conceal UIWebView’s initial white loading view [#iosdev]

Thanks to this StackOverflow thread, I was able to conceal UIWebView’s intial white, “blank page” look while it was loading.

iphone uiwebview inital white view – Stack Overflow

One thing you can try is put a UIView with the color you want and position it above the UIWebView with the same width and height. Then in the webViewDidFinishLoad method, set the UIView to hidden.

Hope it proves useful to someone else.


Iterating through NSDictionary [#iosdev]

This was very helpful to me recently…

Iterating through NSDictionary

Iteration through NSDictionary could be achieved at least in two ways: using NSArray with [NSDictionary allKeys] or NSEnumerator.

Method 1:

NSArray *keyArray =  [bigUglyDictionary allKeys];
int count = [keyArray count];
for (int i=0; i < count; i++) {
  NSDictionary *tmp = [bigUglyDictionary objectForKey:[ keyArray objectAtIndex:i]];

Method 2:

NSEnumerator *enumerator = [bigUglyDictionary keyEnumerator];
id key;
while ((key = [enumerator nextObject])) {
  NSDictionary *tmp = [bigUglyDictionary objectForKey:key];

Second way is a little bit faster, so if you work with huge dictionaries and have no need of array with their keys – use it.


Hope it helps someone else too!

Tip: Generate a File List in TextWrangler [#devtips]

Here’s a really easy way to generate a list of files using TextWrangler:

  1. Open a new window in TextWrangler.
  2. Navigate to the folder you want in Finder.
  3. Drag that folder from the Finder window to the TextWrangler window.
  4. TextWrangler generates a cleanly-formatted listing of all the contents of that folder, including all sub-folders and their contents.

I would imagine this would work in BBEdit as well, but I have not tested it.

Source: See Post #17 here: Mac Rumors – How to print a list of files in a folder