stupid things I will probably do again
An ongoing series.
NSString
has anintValue
method and alongLongValue
method, but it doesn't have alongValue
method.NSValue
has alongValue
method, which means that this will throw an exception at runtime rather than being flagged by the compiler:
NSArray *items = [aString componentsSeparatedByString:aSeparator];
long value = [items[0] longValue];
stupid things I will probably forget again
You can add a gesture recognizer to a
UIImageView
, but it won't do anything until you setuserInteractionEnabled
on.NSString
has adataUsingEncoding:
method, butNSData
doesn't have astringUsingEncoding:
method. You have to use[[NSString alloc] initWithData:encoding:
.[tableView indexPathForCell:cell]
might work some of the time.
[tableView indexPathForRowAtPoint:cell.center]
will work all of the time.