Skip to content

Commit

Permalink
消除performSelector的警告.
Browse files Browse the repository at this point in the history
消除performSelector的警告:
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
        dict = [object performSelector:objectClassInArraySeltor];
#pragma clang diagnostic pop
  • Loading branch information
huangzhibiao committed Mar 17, 2017
1 parent 25e525d commit 4502cb5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion BGFMDB.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "BGFMDB"
s.version = "1.12"
s.version = "1.13"
s.summary = "完美支持iOS大部分类型数据的存储,加入了字典转模型功能模块."

# This description is used to generate tags and improve search results.
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "BGFMDB/ViewController.m"
timestampString = "511406529.915809"
timestampString = "511408748.52857"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "153"
endingLineNumber = "153"
startingLineNumber = "152"
endingLineNumber = "152"
landmarkName = "-viewDidLoad"
landmarkType = "7">
</BreakpointContent>
Expand Down
3 changes: 1 addition & 2 deletions BGFMDB/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ - (void)viewDidLoad {
存储
*/
[p save];

/**
忽略存储,即忽略掉 user,info,students 这三个变量不存储.
*/
Expand Down Expand Up @@ -232,7 +231,7 @@ - (void)viewDidLoad {

-(People*)people{
//存储对象使用示例
[NSObject setDebug:YES];//打开调试模式,输出SQL语句.
[NSObject setDebug:YES];//打开调试模式,打印输出调试信息.
People* p = [People new];
p.name = @"美国队长";
p.num = @(220.88);
Expand Down
3 changes: 3 additions & 0 deletions BGFMDB/libs/BGTool.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

#define SQLITE_NAME @"BGFMDB.sqlite"

// 过期
#define BGFMDBDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead)

// 日志输出
#ifdef DEBUG
#define BGLog(...) NSLog(__VA_ARGS__)
Expand Down
9 changes: 9 additions & 0 deletions BGFMDB/libs/BGTool.m
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,10 @@ +(id)objectFromJsonStringWithClassName:(NSString*)claName valueDict:(NSDictionar
[object setValue:ivarValue forKey:arrKT.firstObject];
}else{
SEL primaryKeySel = NSSelectorFromString([NSString stringWithFormat:@"set%@:",primaryKey]);
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
[object performSelector:primaryKeySel withObject:ivarValue];
#pragma clang diagnostic pop
}
}
}
Expand Down Expand Up @@ -721,7 +724,10 @@ +(NSString*)getUnique:(id)object{
NSString* uniqueKey = nil;
SEL uniqueKeySeltor = NSSelectorFromString(@"uniqueKey");
if([object respondsToSelector:uniqueKeySeltor]){
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
uniqueKey = [object performSelector:uniqueKeySeltor];
#pragma clang diagnostic pop
}
return uniqueKey;
}
Expand All @@ -732,7 +738,10 @@ +(NSDictionary*)getClassInArrayType:(id)object{
NSDictionary* dict = nil;
SEL objectClassInArraySeltor = NSSelectorFromString(@"objectClassInArray");
if([object respondsToSelector:objectClassInArraySeltor]){
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
dict = [object performSelector:objectClassInArraySeltor];
#pragma clang diagnostic pop
}
return dict;
}
Expand Down

0 comments on commit 4502cb5

Please sign in to comment.