How to get the iphone number from sim using xcode or objective c?

NSString *num = [[NSUserDefaults standardUserDefaults]
                           stringForKey:@"SBFormattedPhoneNumber"];
 
NSLog(@"Phone Number: %@", num);</div>

That’s all!

Bookmark and Share
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • StumbleUpon
  • 豆瓣九点

Tags: , , ,

2 Responses to “Objective C Get iPhone number”

  1. springrider 30. Jun, 2009 at 3:54 am #

    Thanks for the tip! But I found it only works when user type there number in iTunes.
    here is the details: http://www.alexcurylo.com/blog/2008/11/15/snippet-phone-number/

  2. admin 02. Jul, 2009 at 11:00 pm #

    NOTE:
    On the iPhone simulator you should receive a “null” value as a result for this call. The same result is obtaining if you run this code on an iPod Touch.

    ——–
    Thanks for the comment!