Re: Large over 100K pixel high ruler scroll view
Re: Large over 100K pixel high ruler scroll view
- Subject: Re: Large over 100K pixel high ruler scroll view
- From: Jens Alfke <email@hidden>
- Date: Tue, 30 Aug 2011 21:14:26 -0700
On Aug 30, 2011, at 8:43 PM, Julie Porter wrote:
> I just can not figure out how to get my data array across multiple *.m files to initialize frame abstraction and call drawRect.
It really has nothing to do with files. You could put your entire program into one source file (in the correct order) and it would compile and run. It has to do with what classes you have and what instance variables, properties and methods those classes have. You can draw this out on paper if it makes it clearer, with boxes for the classes and lines for references between them (i.e. instance variables that are pointers to other objects.)
> But no where do I see a clear concise explanation for 35+ year assembly language postscript C language programmers who still believe with religious dogma that ints are pointers and pointers are ints! I never liked private variables, but am open to evangelical conversion if the arguments are clear.
You might need to back up a bit and find some good introductory books on object-oriented programming. This stuff has been around for a long time (Simula-67 and Smalltalk-72 started it) but it’s become mainstream more recently. It’s definitely a level of abstraction above procedural programming, but it scales much better. Unfortunately I don’t know what books to recommend. I was lucky enough to get into OOP really early (1984, in Smalltalk-80) so it’s like I’m a fish trying to explain how to swim.
I wonder if this stuff would click better for you if you read a low-level explanation of how it’s implemented. Classes are tables that associate message names (selectors) with function pointers, and objects are structs that start with an invisible pointer to their class, and calling a method is a lookup that indirects through the object’s class hierarchy one level at a time until it finds the desired selector, then calls the associated function (passing ‘self’ as an invisible parameter pointing to the object.) I’m not sure if Apple’s Objective-C language book goes into this. The classic Smalltalk-80 ‘Blue Book’ does, I’m pretty sure.
Anyway, I think the most important thing I can say is that this isn’t something you can plow straight into. You need to back up and absorb some theory, because you’re so used to a very different way of working that you’re not going to be able to absorb the OOP way just in the course of working tutorials.
The Wikipedia article on Object-Oriented Programming seems to go into some detail (and links to other articles like Dynamic Dispatch that provide more). It also has a lot of references to useful-sounding books.
http://en.wikipedia.org/wiki/Object-oriented_programming
—Jens_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden