gpt4 book ai didi

ios - 警告 : string is not a string literal(potentially insecure) for code

转载 作者:行者123 更新时间:2023-11-29 12:24:47 25 4
gpt4 key购买 nike

我是 iOS 的初学者,有人可以帮助我吗:
我收到警告:string is not a string literal (potentially insecure) for below code

-( void )gettingEntitySchemaForGivenKayValueFromDataBase:( RequestType )requestType ParamDict:( NSDictionary * )parameterDict
{
PersistenceFromDataBase *persistanceDataObj=[ PersistenceFromDataBase sharedInstance ];
//[ NSJSONSerialization dataWithJSONObject:[ persistanceDataObj getEntitySchemaForGinvenEntityIs:parameterDict ] options:NSJSONWritingPrettyPrinted error:nil ];
NSDictionary *dataDict= [ persistanceDataObj getEntitySchemaForGinvenEntityIs:parameterDict ];
id datatoserialize=[ dataDict objectForKey:VIEWS_KEY ];
NSLog([ NSJSONSerialization dataWithJSONObject:datatoserialize options:NSJSONWritingPrettyPrinted error:nil ])
;
NSLog(@" entitySchemaForEntityId:%@",dataDict );
// [[ NSNotificationQueue defaultQueue ] enqueueNotification:[ NSNotification notificationWithName:ENTITYSCHEMANOTIFICATION object:nil userInfo:@{ USER_INFO:dataDict }] postingStyle:NSPostWhenIdle ];
// sent view data to view controller



}

最佳答案

您的 NSLog 缺少格式说明符。改用这个:

NSLog(@"%@",[NSJSONSerialization dataWithJSONObject:datatoserialize options:NSJSONWritingPrettyPrinted error:nil])
;

关于ios - 警告 : string is not a string literal(potentially insecure) for code,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29554866/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com