开发者

Variable is not a CFString

开发者 https://www.devze.com 2023-03-24 23:10 出处:网络
Somehow the code below crashes my app: NSString *filename = [NSString stringWithFormat:@\"%@%@\", dbPath, @\"BAR\"];

Somehow the code below crashes my app:

NSString *filename = [NSString stringWithFormat:@"%@%@", dbPath, @"BAR"];
NSString *dbS = [NSString stringWithFormat:@"%@%@", "@", filename];

I've set a breakpoint at the dbS string and see that it says "variable is not A CFString." First I thought i开发者_StackOverflow中文版t had to do with the at-symbol, however removing it does not help.

Anyone got a clue what's going on?

Thanks!

P.s. dbPath is defined in my header file --> #define dbPath @"FOO"


Second string should look like this:

NSString *dbS = [NSString stringWithFormat:@"@%@", filename];
0

精彩评论

暂无评论...
验证码 换一张
取 消