Skip to content

Instantly share code, notes, and snippets.

// Flowchat
WatchListServiceRequest *addReq = [[WatchListServiceRequest alloc] initWithRequestType:WatchListServiceRequestAddToList appIdentifier:@"317685067" watchPrice:[NSNumber numberWithFloat:2.99]];
[[WatchListServiceConnection sharedConnection] performServiceRequest:addReq delegate:nil];
[addReq release];
// Rolando 2
addReq = [[WatchListServiceRequest alloc] initWithRequestType:WatchListServiceRequestAddToList appIdentifier:@"321084051" watchPrice:[NSNumber numberWithFloat:0.00]];
[[WatchListServiceConnection sharedConnection] performServiceRequest:addReq delegate:nil];
[addReq release];
(gdb) po [priceArray objectAtIndex:3]
2.99
(gdb) po [appData watchPrice]
2.99
(gdb) print (float) [[priceArray objectAtIndex:3] floatValue]
$25 = 2.99000001
(gdb) print (float) [[appData watchPrice] floatValue]
$26 = 2.99000001
(gdb) print (BOOL) [(NSNumber*)[priceArray objectAtIndex:3] isEqual:(NSNumber*)[appData watchPrice]]
$28 = 0 '\000'
static WatchListServiceConnection *WLSCSharedInstance;
+ (WatchListServiceConnection*)sharedConnection {
@synchronized(self) {
if (WLSCSharedInstance == nil) {
// Even though assignment is already done in allocWithZone: (as it
// should be), assignment is done again here to make Clang SA happy
WLSCSharedInstance = [[WatchListServiceConnection alloc] init];
}
}
#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
- (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;
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]];
- (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:]
<?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>
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: */*