This file contains 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
@interface NSString (url) | |
- (NSMutableArray*) extractURLs ; | |
@end | |
@implementation NSString (url) | |
- (NSMutableArray*) extractURLs { | |
NSString* source = self; | |
NSDataDetector* detector = [NSDataDetector dataDetectorWithTypes:NSTextCheckingTypeLink error:nil]; | |
NSArray* matches = [detector matchesInString:source options:0 range:NSMakeRange(0, [source length])]; | |
LOG([matches description]); | |
NSMutableArray* urls = [NSMutableArray arrayWithCapacity:0]; |
This file contains 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
// | |
// ViewController.m | |
// test | |
// | |
// Created by Tomohisa Takaoka on 10/12/11. | |
// Copyright (c) 2011 __MyCompanyName__. All rights reserved. | |
// | |
#import "ViewController.h" |
This file contains 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
// need to restart app | |
languages = [NSArray arrayWithObjects:@"en",@"ja",nil]; | |
[[NSUserDefaults standardUserDefaults] setObject:languages forKey:@"AppleLanguages"]; |
This file contains 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
tableTweet.autoresizingMask = UIViewAutoresizingNone; | |
CGRect area2 = {0,adView.frame.origin.y+adviewHeight,self.view.bounds.size.width,self.view.bounds.size.height-(adviewHeight)}; | |
tableTweet.transform = CGAffineTransformMakeRotation(M_PI *(-90) / 180.0f); | |
tableTweet.frame=area2; | |
tableHeight = TOVData.columnWidth; | |
tableWidth = tableTweet.frame.size.height; | |
[TOVTweetView setMaximumHeight:tableWidth]; | |
tweetViews = [NSMutableArray arrayWithCapacity:0]; | |
[self renewNodes]; | |
[tableTweet reloadData]; |
This file contains 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
tableTweet.autoresizingMask = UIViewAutoresizingNone; | |
CGRect area2 = {0,adView.frame.origin.y+adviewHeight,self.view.bounds.size.width,self.view.bounds.size.height-(adviewHeight)}; | |
CGPoint center = CGPointMake(area2.origin.x+area2.size.width/2, area2.origin.y+area2.size.height/2); | |
tableTweet.frame = CGRectMake(0, 0,area2.size.width, area2.size.height); | |
tableTweet.center = center; | |
tableTweet.transform = CGAffineTransformMakeRotation(M_PI *(-90) / 180.0f); | |
tableTweet.center = center; |
This file contains 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 *str = [NSString stringWithFormat:@"twitter://user?screen_name=%@", bstr]; | |
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:str]]) { | |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]; | |
}else { | |
UIAlertView*alert = [[UIAlertView alloc] initWithTitle:@"Tweetoverview" message:NSLocalizedString(@"Can not open twitter app. Please install twitter app to send tweet.", @"Can not open twitter app. Please install twitter app to send tweet.") delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil]; | |
[alert show]; | |
} |
This file contains 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)drawRect:(CGRect)rect | |
{ | |
//// General Declarations | |
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
//// Color Declarations | |
UIColor* color = [UIColor colorWithRed: 0.3 green: 0.3 blue: 0.3 alpha: 1]; | |
UIColor* color2 = [UIColor colorWithRed: 0.1 green: 0.1 blue: 0.1 alpha: 1]; | |
UIColor* color3 = [UIColor colorWithRed: 0 green: 0 blue: 0 alpha: 0.69]; |
This file contains 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
+(TOVAppDelegate*)sharedDelegate; | |
+(TOVModel*)sharedModel; |
This file contains 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
// add child view | |
UIViewController* controller = [self.storyboard instantiateViewControllerWithIdentifier:@"test"]; | |
[self addChildViewController:controller]; | |
controller.view.frame = CGRectMake(0, 44, 320, 320); | |
[self.view addSubview:controller.view]; | |
[controller didMoveToParentViewController:self]; | |
// remove child view | |
UIViewController *vc = [self.childViewControllers lastObject]; | |
[vc.view removeFromSuperview]; |
OlderNewer