Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
I have a little bit of experience in Objective-C but I am now digging into the ios. Most of the terminology I am use to is like NSImage but I notice that most things ios has a UI as in UIImage. Is that pretty much for everything like NSString is now UIString (guessing on that one), or can I still use NS?

Thanks
 
Foundation Classes are prefixed with NS while classes related to the User Interface Kit (UIKit) are prefixed with UI.

Example Foundation Classes:
NSString (You're incorrect in assuming this would be called a UIString.)
NSValue
NSArray

Example UIKIt Classes:
UIButton
UITextField
UIImage

I didn't program for the Mac much as the first iOS Dev Kit was released shortly after I began learning how to program, but it's my understanding that many methods for UI classes on a Mac have the same name as their UIKit counterparts on iOS.

I tend to think of Foundation Classes as being more abstract classes, if that's any help.
 
I tend to think of Foundation Classes as being more abstract classes, if that's any help.

Be careful with your terminology, as abstract class has a specific meaning, which is not what you're talking about. Foundation classes are exactly that: fundamental classes that provide the foundation for more complicated classes by providing basic data structures like arrays, strings, dictionaries, etc.
 
Last edited:
Be careful with your terminology, as abstract class has a specific meaning, which is not what you're talking about. Foundation classes are exactly that: fundamental classes that provide the foundation for more complication classes by providing basic data structures like arrays, strings, dictionaries, etc.

How about Foundation Classes are more akin to models? Like, in MVC, an NSString is a model whereas a UILabel is the view? Maybe I should just take out my line about comparing them to anything and just leave my list of examples of each type...
 
Look through the equivalent classes like NSImage and UIImage and you find that they have many differences. Off hand I'm thinking about the properties and methods. Also, the origin is not in the same place.
 
Thanks for the replies. There are some differences.

[textField setStringValue:mad:"Hello"];
[textField setText:mad:"Hello"];
 
Thanks for the replies. There are some differences.

[textField setStringValue:mad:"Hello"];
[textField setText:mad:"Hello"];

There are lots of differences, that's why Apple changed the names of the classes.

You're dealing with UIKit now, not AppKit. When Apple created UIKit for iOS (as part of Cocoa Touch), it looks like they took the opportunity to redesign the kit.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.