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
//時間を算出 | |
NSDate* now = [NSDate date]; | |
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; | |
[dateFormatter setDateFormat:@"HH"]; | |
int hour = [[dateFormatter stringFromDate:now] intValue]; | |
[dateFormatter setDateFormat:@"mm"]; | |
int min = [[dateFormatter stringFromDate:now] intValue]; | |
[dateFormatter setDateFormat:@"s"]; | |
int sec = [[dateFormatter stringFromDate:now] intValue]; | |
NSLog(@"%i:%i:%i",hour,min,sec); |
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
//時間を算出 | |
NSDate* now = [NSDate date]; | |
int hour = [[now dateWithCalendarFormat:nil timeZone:nil] hourOfDay]; | |
int min = [[now dateWithCalendarFormat:nil timeZone:nil] minuteOfHour]; | |
int sec = [[now dateWithCalendarFormat:nil timeZone:nil] secondOfMinute]; | |
NSLog(@"%i:%i:%i",hour,min,sec); |
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
-(NSNumber *) facebook:(NSString*)s | |
{ | |
if(!facebookState) facebookState = [[NSNumber alloc] initWithInt:0]; | |
if(s == @"logout") {//ログアウトの場合 | |
[_facebook logout:self]; | |
facebookState = [[NSNumber alloc] initWithInt:0]; | |
return facebookState; | |
} |
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
// | |
// AppDelegate.h | |
// untitled | |
// | |
#import <UIKit/UIKit.h> | |
#import "FBConnect.h" | |
#define kFBAppId @"xxxxx" //REPLACE ME |
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
static inline void HOLink(NSString *url) | |
{ | |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; | |
} |
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
NSURL *url = [NSURL URLWithString:@"http://google.co.jp"]; | |
[[UIApplication sharedApplication] openURL:url]; |
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
- (void) initScrollLayer | |
{ | |
int pageMax = 3;//ページ数 | |
CGSize s = [[CCDirector sharedDirector] winSize]; | |
//ScrollLayer | |
scroll = [ScrollLayer node]; | |
[scroll changeContentWidth:s.width*pageMax]; | |
[self addChild:scroll]; | |
//Label | |
CCLabel* l0 = [CCLabel labelWithString:@"PAGE01" |
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
//TTFをロード | |
[[FontManager sharedManager] loadFont:@"kroe0556.ttf"]; | |
//ラベルを設置 | |
CCLabel* label = [CCLabel labelWithString:@"FONT LOADED" fontName:@"kroe0556.ttf" fontSize:8]; | |
CGSize size = [[CCDirector sharedDirector] winSize]; | |
label.position = ccp( size.width/2 , size.height/2 ); | |
[self addChild: 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
#import "Calendar.h" | |
NSMutableArray *mList = [[Calendar instance] create:2009 month:10]; | |
NSLog(@"10月12日は [%@]", [[mList objectAtIndex:11] objectForKey:@"h"]); |
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
NSMutableArray *mList = [[Calendar instance] create:2009 month:10]; | |
NSString* s; | |
switch ([[[mList objectAtIndex:0] objectForKey:@"w"] intValue]) | |
{ | |
case 1: | |
s = @"月"; | |
break; | |
case 2: | |
s = @"火"; | |
break; |