Pointer to object in another class?

arcade16

I am retrieving data via SignalR and keeping the most recent data returned in a dictionary that exists in my WebServices class.

I'd like to be able to have a pointer to this dictionary and be able to use the data in many other classes / viewcontrollers.

I want to avoid creating an instance of my WebServices class everywhere I use the data.

How can I accomplish this?

Jeff Loughlin

The usual way to share data like this is to put it in your app delegate class.

Just create the dictionary in your appDelegate, and whenever you need to access it just retrieve it with:

MyAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; 
NSDictionary *myDictionary = appDelegate.myDictionary;

// Do whatever you want with myDictionary
// ...

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to assign a pointer to object to another pointer to object of same class?

From Dev

Assign the pointer of one class object to another class object c++

From Dev

Convert the child object pointer to the base class(from another namespace) pointer

From Dev

c++ how to get a pointer to the current object in another class?

From Dev

Keeping a pointer to another class

From Dev

Initializing a pointer in another class

From Dev

Brooks Pointer in Object class

From Dev

returning a class object with a pointer

From Dev

Get pointer of class object

From Dev

Pointer to method from another class

From Dev

Pointer returning from another class

From Dev

Pointer returning from another class

From Dev

if i use objects of a class inside another class, can i use a pointer to object of 1st class to point to it's members?

From Dev

I want to store value by creating object of another class, but its showing null pointer exception

From Dev

Pass a function pointer to a class object

From Dev

Use a Pointer to an object in Swift class

From Dev

Passing class function pointer to another class

From Dev

accessing the member of a class of pointer array of another class

From Dev

Objective-C - Is the Pointer to a Class different from a pointer to another Class?

From Dev

Objective-C - Is the Pointer to a Class different from a pointer to another Class?

From Dev

Member object of another class

From Dev

Return derived object pointer in base class object

From Dev

Passing a pointer to one derived class to another

From Dev

Accessing another class column from a Pointer in Parse

From Dev

Using function pointer from another class

From Dev

Declare and use a pointer to member function in another class

From Dev

Make a object variable a pointer to another variable

From Dev

C++ Deleting a pointer to a object that contains another pointer

From Dev

Qt - QDataStream with overloaded operator<< for object pointer (Class*)

Related Related

  1. 1

    How to assign a pointer to object to another pointer to object of same class?

  2. 2

    Assign the pointer of one class object to another class object c++

  3. 3

    Convert the child object pointer to the base class(from another namespace) pointer

  4. 4

    c++ how to get a pointer to the current object in another class?

  5. 5

    Keeping a pointer to another class

  6. 6

    Initializing a pointer in another class

  7. 7

    Brooks Pointer in Object class

  8. 8

    returning a class object with a pointer

  9. 9

    Get pointer of class object

  10. 10

    Pointer to method from another class

  11. 11

    Pointer returning from another class

  12. 12

    Pointer returning from another class

  13. 13

    if i use objects of a class inside another class, can i use a pointer to object of 1st class to point to it's members?

  14. 14

    I want to store value by creating object of another class, but its showing null pointer exception

  15. 15

    Pass a function pointer to a class object

  16. 16

    Use a Pointer to an object in Swift class

  17. 17

    Passing class function pointer to another class

  18. 18

    accessing the member of a class of pointer array of another class

  19. 19

    Objective-C - Is the Pointer to a Class different from a pointer to another Class?

  20. 20

    Objective-C - Is the Pointer to a Class different from a pointer to another Class?

  21. 21

    Member object of another class

  22. 22

    Return derived object pointer in base class object

  23. 23

    Passing a pointer to one derived class to another

  24. 24

    Accessing another class column from a Pointer in Parse

  25. 25

    Using function pointer from another class

  26. 26

    Declare and use a pointer to member function in another class

  27. 27

    Make a object variable a pointer to another variable

  28. 28

    C++ Deleting a pointer to a object that contains another pointer

  29. 29

    Qt - QDataStream with overloaded operator<< for object pointer (Class*)

HotTag

Archive