iPhone Apps, Objective C, a Graph, and Functions vs. Objects (or something like that)

Posted by BillEccles on Stack Overflow See other posts from Stack Overflow or by BillEccles
Published on 2010-06-17T00:42:13Z Indexed on 2010/06/17 0:52 UTC
Read the original article Hit count: 278

Filed under:
|
|
|

Gentleones,

I've got a UIImageView that I have in a UIView. This particular UIImageView displays a PNG of a graph. It's important for this particular view controller and another view controller to know what the graph "looks like," i.e., the function described by the PNG graph. These other view controllers need to be able to call a "function" of some sort with the X value returning the Y value.

Please ignore the fact (from an outsider's perspective) that I could probably generate the graph programmatically.

So my questions are:

1 - Where should I put this function? Should it go in one view controller or the other, or should it go in its own class or main or...?

2 - Should it be an object in some way? Or should it be a straight function? (In either case, where's it belong?)

Pardon the apparent n00b-iness of the question. It's 'cause I'm honestly a n00b! This OOP stuff is giving my head a spin having been a procedural programmer for >30 years. (And I choose to learn it by jumping into an iPhone app. Talk about baptism by fire!)

Thanks in advance,
Bill

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c