Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios NSDictionary initWithObjectsAndKeys from宏失败_Ios_Macros_Nsdictionary - Fatal编程技术网

Ios NSDictionary initWithObjectsAndKeys from宏失败

Ios NSDictionary initWithObjectsAndKeys from宏失败,ios,macros,nsdictionary,Ios,Macros,Nsdictionary,我试图初始化一个同时包含键和值的NSDictionary,我想从定义的宏初始化: #define _FILETYPES @".c", @"c", @".h", @"c",".cpp", @"cpp", @".d", @"d", @".hs", @"haskell", @".lua", @"lua", @".ml", @"ocaml", @".mli", @"ocaml", @".php", @"php", @".pl", @"perl", @".py", @"python", @".rb", @

我试图初始化一个同时包含键和值的NSDictionary,我想从定义的宏初始化:

#define _FILETYPES @".c", @"c", @".h", @"c",".cpp", @"cpp", @".d", @"d", @".hs", @"haskell", @".lua", @"lua", @".ml", @"ocaml", @".mli", @"ocaml", @".php", @"php", @".pl", @"perl", @".py", @"python", @".rb", @"ruby", @".scm", @"scheme", @".ss", @"scheme", @".tcl", @"tcl", nil


#define _LANGS @"c", @"C", @"cpp", @"C++", @"d", @"D", @"haskell", @"Haskell", @"lua", @"Lua", @"ocaml", @"OCaml", @"php", @"PHP", @"perl", @"Perl", @"python", @"Python", @"ruby", @"Ruby", @"scheme", @"Scheme", @"tcl", @"Tcl", nil

self.languages = [[NSDictionary alloc] initWithObjectsAndKeys:_LANGS];
self.filetypes = [[NSDictionary alloc] initWithObjectsAndKeys:_FILETYPES];
你能告诉我为什么这不起作用吗。我以前也曾启动过类似的阵列。。。
问题是,当我到达alloc行时,代码抛出一个EXC_BAD_ACCESS

你忘记了@before.cpp”和“perl”。

你忘记了@before.cpp”和“perl”。

它怎么不工作?它工作了,实际上:)键c在_FILETYPESHow中使用了两次,它不工作吗?它工作了,实际上:)c键在_FILETYPESGood catch!中使用了两次(在问题代码中,它仅在“.cpp”之前缺失)好的捕获(在问题代码中,它仅在“.cpp”之前缺失)