O'Reilly logo

Objective-C Recipes: A Problem-Solution Approach by Matthew Campbell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter    2

Working With Strings and Numbers

This chapter covers how to work with strings and numbers using the Foundation framework with Objective-C.

The recipes in this chapter will show you how to:

  • Create a string object using NSString
  • Read strings from text files on Mac and iOS
  • Write strings to text files on Mac and iOS
  • Compare strings
  • Manipulate strings
  • Search through strings
  • Create localized strings
  • Convert between numbers and strings
  • Format numbers for currency and other presentations

NOTE: The recipes in this chapter may be used with any Mac or iOS app that links to the Foundation framework. Follow one of the recipes from Chapter 1, such as 1.1, to set up an app to test out the code in this chapter. Be sure to locate the code in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required