Skip to content

Instantly share code, notes, and snippets.

# Find the executable from the dsym.
$dsymdir =~ /(.*)\/(.*).dSYM/;
my $pathToDsym = $1;
my $dsymBaseName = $2;
my $executable = $dsymBaseName;
$executable =~ s/\..*//g; # strip off the suffix, if any
chop($executable);
print STDERR "$executable\n";
# my @paths = glob "$pathToDsym/$dsymBaseName\{,/$executable,/Contents/MacOS/$executable}";
// Debug-build only logging macro
#ifdef DEBUG
#define debugLog(format, ...) NSLog((format), ##__VA_ARGS__)
#else
#define debugLog(format, ...) // Nothing
#endif
- (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event {
UITouch *touch = [touches anyObject];
if (CGPointEqualToPoint([touch previousLocationInView:self], [touch locationInView:self]))
[controller toggleToolbars];
[super touchesEnded:touches withEvent:event];
}
The resulting stack trace, 2nd time around:
#0 0x00009f84 in -[ScreenshotsScrollView touchesEnded:withEvent:] at ScreenshotsScrollView.m:22
21:58:24.271922 IP 192.168.1.75.52705 > 209.8.115.150.http: P 1:712(711) ack 1 win 32942 <nop,nop,timestamp 443235121 952676702>
E.....@[email protected][email protected].....
.k;18..^GET /WebObjects/MZStore.woa/wa/viewSoftware?id=292421271&mt=8 HTTP/1.1
Cookie: X-Dsid=16172939; a=AAAAAgAAAB4AInBQdkJsc2dpVVdjLUZCYkhkdHpodDBHUndlZjZBS0J2cUEAH/hzAAABHmE05oE=; s_vi=[CS]v1|48EB9D1700006FCC-A2C0C16000004AE[CE]; asbid=sA99YK9DKDXJPJ2AJ; dssid=63087516-8795-4962-954c-2e625a2db375; Pod=9
X-Apple-Connection-Type: WiFi
User-Agent: iTunes-iPhone/2.2 (2)
Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.9,ja;q=0.8,nl;q=0.8,it;q=0.7,es;q=0.7,pt;q=0.6,pt-PT;q=0.6,da;q=0.5,fi;q=0.5,nb;q=0.4,sv;q=0.4,ko;q=0.3,zh-Hans;q=0.3,zh-Hant;q=0.2,ru;q=0.2,pl;q=0.1
X-Apple-Store-Front: 143441-1,2
X-Dsid: 16172939
Accept: */*
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>page-type</key>
<dict>
<key>template-name</key><string>software</string>
<key>template-parameters</key>
<dict>
</dict>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>page-type</key>
<dict>
<key>template-name</key><string>software</string>
<key>template-parameters</key>
<dict>
</dict>
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
CGContextTranslateCTM(context, 0, rect.size.height);
CGContextScaleCTM(context, 1, -1);
// Do some drawing with CGContextDrawImage()
CGContextRestoreGState(context);
// Do some drawing with -[NSString(UIDrawing) drawInRect:]
NSString *htmlBody = @"you probably want something HTML-y here";
NSString *escapedBody = [(NSString*)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)htmlBody, NULL, CFSTR("?=&+"), kCFStringEncodingUTF8) autorelease];
NSString *mailtoPrefix = [@"mailto:?subject=Some Subject&body=" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString *mailtoStr = [mailtoPrefix stringByAppendingString:escapedBody];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:mailtoStr]];
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier {
if ((self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier])) {
backgroundImageView = [[UIImageView alloc] initWithImage:nil];
backgroundImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
self.backgroundView = backgroundImageView;
[backgroundImageView release];
textLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 20)];
textLabel.center = CGPointMake(160, self.contentView.center.y);
textLabel.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;
#ifdef DEBUG
#define debugLog(fmt, ...) NSLog(@"%s (%@:%d) %@", \
__PRETTY_FUNCTION__, \
[[NSString stringWithUTF8String:__FILE__] lastPathComponent], \
__LINE__, \
[NSString stringWithFormat:(s), ##__VA_ARGS__])
#else
#define debugLog(fmt, ...)
#endif