摘要:
在XCode的以前版本中,如果遇到了[代码]c#/cpp/oc代码:1message sent to deallocated instance 0x6d564f0我们可以使用info malloc-history 0x6d564f0来查看调用堆栈来查看崩溃发生的地方,这种方法这里不作阐述,大家自行百度。在新的XCode里,调试器默认使用LLDB,我就讲一下如何在LLDB状态下定位到由于内存操作不当引起的Crash首先我有一段会发生崩溃的代码:[代码]c#/cpp/oc代码:1NSString *themePath = [[[NSBundle mainBundle] resourcePath] 阅读全文
摘要:
-(BOOL) textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{NSMutableString *text = [[moneyInputField.text mutableCopy] autorelease];[text replaceCharactersInRange:range withString:string];return [text length] <= 12;} 阅读全文
摘要:
$(inherited) "$(SRCROOT)/.a文件所在的文件名"//如果有多个.a文件格式就像这样$(inherited) "$(SRCROOT)/xxxx" "$(SRCROOT)/xx"如果取的是相对是绝对路径那么工程移到别的地方就有可能导致运行出错。所以要改成相对路径 阅读全文
摘要:
NSDictionary to jsonString [self DataTOjsonString:dic]-(NSString*)DataTOjsonString:(id)object{ NSString *jsonString = nil; NSError *error; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:object options:NSJSONWritingPrettyPrint... 阅读全文
摘要:
UILabel * label1 = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 320, 30)]; label1.text = @"qingjoin"; [self.view addSubview:label1]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; [UIView setAnimationDuration:3.0]; ... 阅读全文
摘要:
#pragma mark get country code//同步-(void)getFKjsonCountryCode{ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSString *urlString = [NSString stringWithFormat:@"http://www.baidu.com"]; NSMutableURLRequest *request = [[[NSMutableURLRequest al... 阅读全文
摘要:
//ios Url Encode //有时候在请求的参数里里特殊符号比如“+”等。而如果没有encode的话那么传过去的还是” ”,面实际上是%2B。-(NSString*)UrlValueEncode:(NSString*)str{ NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFS... 阅读全文
摘要:
当不小心在工程文件中删掉文件时。有可能会提示.xxx is missing from working copy有可能是SVN引起的。删掉这个文件就好了如果是单个文件。进入Terminal 相应的路径,svn delete XXX批量删除这时候我们打开Terminal(终端) 输入cd 空格 然后把在网上工程到Terminal 回车输入命令行rm-rf`find.-typed-name.svn`then the worning is missed ... 阅读全文
摘要:
//用法 加密转base 64NSString *str = [self base64StringFromText:@"qingjoin" withKey:@"key"];//转base 64 解密 NSString *stred = [self textFromBase64String:str withKey:@"key"];//文本先进行DES加密。然后再转成base64+ (NSString *)base64StringFromText:(NSString *)text withKey:(NSString*)key{ if (t 阅读全文
摘要:
//iOS DES ECB 模式加密 #importstatic Byte iv[] = {1,2,3,4,5,6,7,8};+(NSString *) encryptUseDES:(NSString *)plainText key:(NSString *)key { NSString *ciphertext = nil; const char *textBytes = [plainText UTF8String]; NSUInteger dataLength = [plainText length]; ... 阅读全文