Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / May 2006



Tip: Looking for answers? Try searching our database.

help; methodologically confused

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul - 25 May 2006 00:08 GMT
Hi,

My app has a window with a myView, an AppController and my own class to
read and write my data files.

The AppController has buttons to open the data file and manipulate the
data and has myView as an outlet to display the data. It's similar to
the way Hillegrass displayed a jpg in his Cocoa book using [stretchView
setView] in his AppController to shuffle the jpg to his View class.

So, AppController knows about myView and the data file which I call
pagefile.m. but myView doesn't know about pagefile.m

It would be better to manipulate the data further before I display it in
myView but because it has a lot to do I really want another class to do
it called pageview.m. This is where I'm lost.

I can have AppController know about myView, pagefile and pageview but I
want to have myView know about pageview and call it's "show" function in
myView's "drawRect". So pageview is known by AppController and myView -
I'm totally stuck and confused about how to do this simply. Obviously
I'm missing the "big picture" somewhere.

Any help appreciated, thanks.

Paul
David Phillip Oster - 25 May 2006 02:23 GMT
> My app has a window with a myView, an AppController and my own class to
> read and write my data files.
[quoted text clipped - 16 lines]
> I'm totally stuck and confused about how to do this simply. Obviously
> I'm missing the "big picture" somewhere.

You'd probably be better off by starting again with the Cocoa document
app stationery, with a document class that has an outlet to its view.

But, if you want to keep going with your existing architecture, remember
that your view can always use:

[NSApp delegate]

to get a pointer to the AppController.

you might consider renaming pageview.m to imagedecal.m  Then, it is
quite clean for myView's drawrect to ask the appController for an
appropriate imageDecal  and tell it to draw itself.

The name change makes clear that imageDecal isn't a view itself, but if
something a view can use to draw an image.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.