This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *postwords = @"test"; | |
NSString *post = [NSString stringWithFormat:@"entry.0.single=%@&pageNumber=0&backupCache=&submit=Submit",postwords]; | |
NSData *postData = [post dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES]; | |
NSString *postLength = [NSString stringWithFormat:@"%d", [post length]]; | |
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; | |
[request setURL:[NSURL URLWithString:@"https://docs.google.com/spreadsheet/formResponse?formkey=yourformkey;ifq"]]; | |
[request setHTTPMethod:@"POST"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSColor+Hex.h | |
// | |
// Created by 61 on 2/1/12. | |
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | |
// | |
#import <AppKit/AppKit.h> | |
@interface NSColor (Hex) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSTextField *label = [[NSTextField alloc] initWithFrame:CGRectMake(0, 0, 320, 25)]; | |
[label setEditable:NO]; | |
[label setBordered:NO]; | |
[label setFont:[NSFont systemFontOfSize:17.0]]; | |
[label setBackgroundColor:[NSColor clearColor]]; | |
[label setTextColor:[NSColor blackColor]; | |
[label.cell setLineBreakMode:NSLineBreakByTruncatingTail]; | |
[label setAutoresizingMask:NSViewMaxXMargin|NSViewMaxYMargin|NSViewWidthSizable]; | |
[label setStringValue:@"this is a label"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSTextField *label = [[NSTextField alloc] initWithFrame:CGRectMake(0, 0, 320, 25)]; | |
[label setEditable:NO]; | |
[label setBordered:NO]; | |
[label setFont:[NSFont systemFontOfSize:17.0]]; | |
[label setBackgroundColor:[NSColor clearColor]]; | |
[label setTextColor:[NSColor blackColor]; | |
[label.cell setLineBreakMode:NSLineBreakByTruncatingTail]; | |
[label setAutoresizingMask:NSViewMaxXMargin|NSViewMaxYMargin|NSViewWidthSizable]; | |
NSFont *font = [NSFont systemFontOfSize:14.0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSTextField *timeLabel = [[NSTextField alloc] initWithFrame:CGRectMake(0, 0, 320, 20)]; | |
[timeLabel setAutoresizingMask:NSViewMaxXMargin|NSViewMaxYMargin|NSViewWidthSizable]; | |
[timeLabel setEditable:NO]; | |
[timeLabel setBordered:NO]; | |
[timeLabel setAlignment:NSLeftTextAlignment]; | |
[timeLabel setBackgroundColor:[NSColor clearColor]]; | |
NSString *originString = @"firstsecondthird"; | |
NSMutableAttributedString * string = [[NSMutableAttributedString alloc] initWithString:originString]; | |
[string addAttribute:NSForegroundColorAttributeName value:[NSColor redColor] range:NSMakeRange(0,5)]; | |
[string addAttribute:NSForegroundColorAttributeName value:[NSColor greenColor] range:NSMakeRange(5,6)]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
王 | |
江 | |
周 | |
胡 | |
刘 | |
李 | |
吴 | |
毛 | |
温 | |
习 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSUInteger)hitTestForEvent:(NSEvent *)event inRect:(NSRect)frame ofView:(NSView *)controlView { | |
NSRect checkBoxFrame = [self _checkBoxFrameForInteriorFrame:frame]; | |
NSPoint point = [controlView convertPoint:[event locationInWindow] fromView:nil]; | |
// Delegate hit testing to other cells | |
if (_checkBoxCell) { | |
if (NSPointInRect(point, checkBoxFrame)) { | |
return NSCellHitTrackableArea; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSFont *font = [NSFontsystemFontOfSize:14.0]; | |
NSShadow *textShadow = [[NSShadowalloc] init]; | |
[textShadow setShadowColor:[NSColorcolor whiteColor]]; | |
[textShadow setShadowOffset:CGSizeMake(0, -1.0)]; | |
NSDictionary *attrsDictionary = [NSDictionary dictionaryWithObjects:[NSArrayarrayWithObjects:font, textShadow, nil] | |
forKeys:[NSArrayarrayWithObjects:NSFontAttributeName, NSShadowAttributeName, nil]]; | |
CGSize size = [@"string" sizeWithAttributes:attrsDictionary]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGFloat width = 100.0; | |
NSDictionary *attrDic = [NSDictionary dictionaryWithObject:[NSFont systemFontOfSize:14.0] forKey:NSFontAttributeName]; | |
NSSize limit = NSMakeSize(width, (unsigned int)-1); | |
CGRect frame = [@"this is the test string" boundingRectWithSize:limit options:(NSStringDrawingDisableScreenFontSubstitution | NSStringDrawingUsesLineFragmentOrigin) attributes:attrDic]; | |
OlderNewer