使用正则表达式导入RegexKitLite.m出现警告的问题

前端之家收集整理的这篇文章主要介绍了使用正则表达式导入RegexKitLite.m出现警告的问题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

转载自:http://www.cocoachina.com/bbs/read.PHP?tid-115146.html


我这里需要判断手机号码,qq号码,邮箱等的规范,所以需要用到正则表达式,导入RegexKitLite.h之后就出现了警告

?
1
2
3
id functionString = [exception objectForKey:@ "function" ],fileString = [exception objectForKey:@ "file" "description" "line" ];
RKLCHardAbortAssert((functionString != NULL ) && (fileString != ) && (descriptionString != ) && (lineNumber != ));
[[ NSAssertionHandler currentHandler] handleFailureInFunction:functionString file:fileString lineNumber:( NSInteger )[lineNumber longValue] description:descriptionString];


这就是出现警告的地方, Format string is not a string literal (potentially insecure)
这里该怎么修改才可以去掉警告呢


description:descriptionString,nil];


还有个地方说这样改:

;

 [[NSAssertionHandler currentHandler] handleFailureInFunction:functionString file:fileString lineNumber:(NSInteger)[lineNumber longValue] description:descriptionString];
 
 
A :  
[[ 
NSAssertionHandler 
 
currentHandler 
] 
handleFailureInFunction 
:functionString 
file 
:fileString 
lineNumber 
:( 
NSInteger 
)[lineNumber 
longValue 
description 
: 
@"%@" 
,descriptionString]; 
 

转载自:http://blog.csdn.net/shijiucdy/article/details/8755667

猜你在找的正则表达式相关文章