0

How do i fix the following code

return [(NSNetwork*)CFDictionaryGetValue( _networkMap, address) retain];

fixed to

return [(NSNetwork*)CFDictionaryGetValue( _networkMap, (__bridge const void *)address)];

Its says expected identifier.I am unable to figure out. Can u guys help me plz?

user2798258
  • 171
  • 1
  • 4
  • 13
  • Just remove square brackets - you need them only if you're going to invoke a method. – kovpas Mar 03 '14 at 09:20
  • As @kovpas says `return (NSNetwork*)CFDictionaryGetValue( _networkMap, (__bridge const void *)address);` – sbarow Mar 03 '14 at 09:24

2 Answers2

2

Just change your return statement to this:

return (NSNetwork*)CFDictionaryGetValue( _networkMap, (__bridge const void *)address);

Hope this helps.. :)

Rashad
  • 10,839
  • 4
  • 43
  • 71
-3

I hope this is usefull for you..

Do you exclude them from arc with Compiler flag -fno-objc-arc ? You can see a Answer here

Community
  • 1
  • 1
Raju
  • 771
  • 3
  • 18
  • 3
    How does that answer the question? If the OP wants to convert from MRR to ARC, avoiding whole files is a bit cowardly. – trojanfoe Mar 03 '14 at 09:22
  • 1
    @AppleMap this in no way answers the question. All they need to do is remove the `[ ]` brackets. Why do they need to exclude the whole file from `ARC`? There is no need -1 – Popeye Mar 03 '14 at 09:27
  • @AppleMap its fine to set that flag if your code does not actually support ARC but like the OP says he is trying to fix an ARC issue, not by removing ARC but by implementing it. Your solution will silences errors not fix the issue. – sbarow Mar 03 '14 at 09:33
  • @AppleMap stopping the file from using `ARC` isn't a solution at all. Sooner or later they will have convert that file to use `ARC`. Look at solving the problem not hiding it. – Popeye Mar 03 '14 at 09:40