GithubHelp home page GithubHelp logo

Comments (4)

mustafa avatar mustafa commented on September 10, 2024

Can you please elaborate on what you mean by "bad things are happening".

from evernote-sdk-ios.

udibr avatar udibr commented on September 10, 2024

Hi,
I have the regular AFNetworking being used in my code.
Your code started from an old branch of AFNetworking (fork from 1.x I think) and then you modified it to fit your needs.
In order to avoid compilation errors for people like me, you changed the names of the constants so they will not conflict with the same names used in AFNetworking.

HOWEVER, the string values assigned to the constants (which can be any string in the world you like) remained identical to the values used in AFNetworking. As a result for example, when your code generates a notification you have a separate piece of code that wait for this event and respond BUT there is also a piece of code in AFNetworking which waits for the same event (based on the string value and not based on the name of the constant) and it also responds to the notification. By chance this may work but there is a very high probability that the code responding in AFNetworking does not behave correctly

This is what happened to me when my code switched to use AFNetworking 2.0

from evernote-sdk-ios.

mustafa avatar mustafa commented on September 10, 2024

The notifications are supposed to be global to the app, so there can be multiple of them being posted. Will upgrading to AFNetworking 2.0 solve your issue?

from evernote-sdk-ios.

udibr avatar udibr commented on September 10, 2024

No need to move to AFNetworking 2.
Your code replicates AFNetworking (with minor name changes) but it generates notification that are supposed
to be handled only by your replicated code and instead it is handled by both your code and the AFNetworking 2 code my App has.

What you should do is put "EN" inside the strings you hold as constants. All parts of your code will use the same constant and communicate with each other but my AFNetworking2 code will not respond.

In other words, when you decided to incorporate AFNetworking code inside your code you did the right thing in renaming the constants but you should have also renamed the string values stored in them

Thanks

from evernote-sdk-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.