IPAD must-haves. And fun-to-haves.

Brighten your iPad with a colorful cover, stream to your TV, download pictures from your digital camera, and more. There’s already so much you can do with iPad and iPad mini

Apple Wireless Keyboard

The incredibly thin Apple Wireless Keyboard uses Bluetooth technology, which makes it compatible with iPad

Apple unveils iPad mini: ‘Thin as a pencil, light as paper’

iPad inspires creativity and hands-on learning with features you won’t find in any other educational tool

Lightning connector and FaceTime HD camera

Apple announces 4th generation iPad packing an A6X CPU

Pages

Showing posts with label Converting. Show all posts
Showing posts with label Converting. Show all posts

Sunday, June 9, 2013

Converting nsdates to NSStrings and vice-versa

hi, as part of an app I'm writing(my first) I need to constantly convert NSDates to NSStrings and vice-versa. So I thought I would write the 2 functions but include them as methods with the main controller and call them with something like

 

[self convertToDate:stringToConvert]

 

However , I'm experiencing problems and getting warnings all over the place - may be because I'm calling them from within 'proper' methods in the class. The functions themselves are pretty straight forward and I've copied them from forums like this one

 

I realise this is probably not best practice , but how else would I do it? Would I create a separate .h and .m files.

 

Any thoughts would be gratefully received.  I have posted threads about mixing normal functions and methods on this forum and I am grateful for all your feedback , and this relates to this matter , but I'm starting to wonder if my approach is wrong?


View the original article here

Re: Converting nsdates to NSStrings and vice-versa

From the class definition for NSDate:

 

To parse strings containing dates and to generate string representations of a date, you should use an instance of NSDateFormatter using the methodsdateFromString

 

To go from date to string see NSDate's description and descriptionWithLocale: methods


View the original article here

Re: Converting nsdates to NSStrings and vice-versa

From the class definition for NSDate:

 

To parse strings containing dates and to generate string representations of a date, you should use an instance of NSDateFormatter using the methodsdateFromString

 

To go from date to string see NSDate's description and descriptionWithLocale: methods


View the original article here

Re: Converting nsdates to NSStrings and vice-versa

From the class definition for NSDate:

 

To parse strings containing dates and to generate string representations of a date, you should use an instance of NSDateFormatter using the methodsdateFromString

 

To go from date to string see NSDate's description and descriptionWithLocale: methods


View the original article here