PDA

View Full Version : Collection Classes and String Split Function




teguh123
Mar 31, 2011, 01:50 PM
Does objective C has collection class? Is it NSArray?

Is there a way to split string by some character, say * and get an array?

I want to be able to "sort" that collection. Perhaps by using some form of lambda expression.



admanimal
Mar 31, 2011, 02:24 PM
Since you are asking about an operation on a string, I suggest you look at the documentation for NSString.

chown33
Mar 31, 2011, 03:12 PM
Does objective C has collection class? Is it NSArray?

Is there a way to split string by some character, say * and get an array?

I want to be able to "sort" that collection. Perhaps by using some form of lambda expression.

This is the third time I've posted this information, in replies to your questions.

See this reply on your other thread:
http://forums.macrumors.com/showthread.php?p=12261166&highlight=#post12261166

The Collections Programming Topics link has as its first section "Arrays: Ordered Collections". That has a sub-section "Sorting Arrays".
http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/Collections/Articles/Arrays.html%23//apple_ref/doc/uid/20000132-BBCCJBIF

I suggest you read the entire Collections Programmings Topics document, and then look at the second link, which lists all the classes in the Foundation framework.

PhoneyDeveloper
Mar 31, 2011, 03:15 PM
Yes, all those things are do-able. Look at these guides:

Collections Programming Topics Guide
String Programming Guide for Core Foundation
Sort Descriptor Programming Topics

chown33
Mar 31, 2011, 03:27 PM
Yes, all those things are do-able. Look at these guides:

Collections Programming Topics Guide
String Programming Guide for Core Foundation
Sort Descriptor Programming Topics

To those three, I would also add this:
Cocoa Naming Conventions:
http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html