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)saveImageFile | |
{ | |
NSData *data = UIImagePNGRepresentation(uiimage); | |
NSString *filePath = [NSString stringWithFormat:@"%@/sample.png" ,[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]]; | |
[data writeToFile:filePath atomically:YES]; | |
} |
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*)consoleLogFileWithDate | |
{ | |
NSDateFormatter *inputDateFormatter = [[NSDateFormatter alloc] init]; | |
[inputDateFormatter setDateFormat:@"yyyyMMddHHmmss"]; | |
[inputDateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"US"]]; | |
NSString *dateStr = [inputDateFormatter stringFromDate:[NSDate date]]; | |
return [NSString stringWithFormat:@"console%@.log",dateStr]; | |
} | |
static FILE *consoleLog; |
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)convertToJsonFromDictionary | |
{ | |
NSDictionary *paramDic = @{@"flg": @"true", | |
@"result":[NSNull null]}; | |
NSData *paramData = nil; | |
if([NSJSONSerialization isValidJSONObject:paramDic]){ | |
paramData = [NSJSONSerialization dataWithJSONObject:paramDic options:NSJSONWritingPrettyPrinted error:nil]; | |
NSLog(@"%@",paramDic); | |
NSLog(@"%@",[[NSString alloc] initWithData:paramData encoding:NSUTF8StringEncoding]); | |
} |
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
- (NSArray *)randomShuffle:(NSMutableArray *)array | |
{ | |
for (NSInteger i=0; i<[array count]; i++) { | |
int exchagingIndex = arc4random() % [array count];//from 0 to count | |
[array exchangeObjectAtIndex:i withObjectAtIndex:exchagingIndex]; | |
} | |
return array; | |
} |
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)viewDidLoad | |
{ | |
_newsLabel.text = @"abcdefgh......."; | |
[self startSlideNewsAnimation]; | |
} | |
- (void)startSlideNewsAnimation | |
{ | |
NSString *news = _newsLabel.text; | |
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
BOOL _isShowingPicker; | |
NSArray *_sizeTexts; | |
NSInteger _sizeIndex; | |
@property (strong,nonatomic) UIView *pickerMainView; | |
@property (strong,nonatomic) UIPickerView *pickerView; | |
@property (strong,nonatomic) UIBarButtonItem *pickerBarButtonItem; | |
- (void)initPickerView | |
{ |
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
//@"あいう":6 | |
//@"abc":3 | |
- (NSInteger)textCountWithString:(NSString *)string | |
{ | |
return [string lengthOfBytesUsingEncoding:NSShiftJISStringEncoding]; | |
} |
OlderNewer