skip to Main Content

Looks like the Xcode introduces more and more new problems to developers.
Does anyone know what the hell is this issue and how to get rid of it?: The property is defined on XXX, and may not be available in this context.

The property exists in this scope and the code runs without any problems, but auto-complete is broken as always… enter image description here

4

Answers


  1. I resolve this issue by checking pods versions installed, upgrade or downgrade pods to access this method.
    In project folder delete pods folder and reinstall it.
    Check the pods versions twice which is needed to be update.

    Login or Signup to reply.
  2. So what I’m noticing is that ever since upgrading from Xcode 12 to Xcode 13, instead of a property not displaying in auto-complete (because it is inaccessible in the current scope), it seems that Xcode 13 displays it in auto-complete with the warning/error that the property may not be available in the context. In other words, Xcode 13 seems to recognize the property exists somewhere but, in theory, shouldn’t be available in the current scope

    In short, I suppose this (seemingly new?) warning is basically Xcode telling you it thinks the property isn’t available in the scope but can’t be 100% sure, so it allows you to use it at your own risk (although usually Xcode is right and you mistakenly think it should be accessible when it isn’t).

    Login or Signup to reply.
  3. You might get that message if you’re accessing a property from a header inside a framework, and the header is not added to the framework’s umbrella header.

    In that case, the solution is to add the header to the umbrella header.

    Login or Signup to reply.
  4. I had a similar issue with undoActionName and redoActionName. The fix was easy – I simply added undoManager. in front. undoManager inherits from UndoManager. So, try putting the class XXX.table.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search