I get basic data types, and I get classes. When dealing with data types, you're dealing with the actual data. With classes, you're only dealing with the pointer to the data.
Where do structures come into it and why are they needed? Wouldn't a class work well enough if more than one piece of data formed part of the object?
I have reached some exercises in a book I have which seeks to render a user's location on a map, and adds annotations etc. Quite a few arguments that are passed to the MKMapView or a CLLocationManager seem to be these things, and I'm just not sure I get the role they play as a holder of data in the same way I understand basic data types and classes.
Also, how are you meant to know if something is a structure - is there a naming convention or are you just meant to know from the documentation and the absence of the * when declaring them?
And finally, when passing arguments to something and those arguments sit within () brackets, is this the syntax for structures (as in structures use (), whilst classes use [] as part of the method calling syntax)? So, for example, is NSLog a structure?
Thank you
Where do structures come into it and why are they needed? Wouldn't a class work well enough if more than one piece of data formed part of the object?
I have reached some exercises in a book I have which seeks to render a user's location on a map, and adds annotations etc. Quite a few arguments that are passed to the MKMapView or a CLLocationManager seem to be these things, and I'm just not sure I get the role they play as a holder of data in the same way I understand basic data types and classes.
Also, how are you meant to know if something is a structure - is there a naming convention or are you just meant to know from the documentation and the absence of the * when declaring them?
And finally, when passing arguments to something and those arguments sit within () brackets, is this the syntax for structures (as in structures use (), whilst classes use [] as part of the method calling syntax)? So, for example, is NSLog a structure?
Thank you
Last edited: