<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3924016210665027086</id><updated>2024-09-08T21:59:46.293-07:00</updated><category term="NSLog"/><title type='text'>iOS</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://iosrefernecebook.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3924016210665027086/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://iosrefernecebook.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Timmi</name><uri>http://www.blogger.com/profile/08747989656493505509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3924016210665027086.post-4892288632044635693</id><published>2011-06-03T01:49:00.000-07:00</published><updated>2011-06-03T01:49:20.945-07:00</updated><title type='text'>How to get the current orientation on iPhone/iPad</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;b&gt;UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation];&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The UIInterfaceOrientation is an enum:&lt;br /&gt;
typedef enum {&lt;br /&gt;
&amp;nbsp; UIInterfaceOrientationPortrait &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = UIDeviceOrientationPortrait,&lt;br /&gt;
&amp;nbsp; UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,&lt;br /&gt;
&amp;nbsp; UIInterfaceOrientationLandscapeLeft &amp;nbsp; &amp;nbsp; &amp;nbsp;= UIDeviceOrientationLandscapeLeft,&lt;br /&gt;
&amp;nbsp; UIInterfaceOrientationLandscapeRight &amp;nbsp; &amp;nbsp; = UIDeviceOrientationLandscapeRight&lt;br /&gt;
} UIInterfaceOrientation;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;lang-c prettyprint&quot;&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iosrefernecebook.blogspot.com/feeds/4892288632044635693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://iosrefernecebook.blogspot.com/2011/06/how-to-get-current-orientation-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3924016210665027086/posts/default/4892288632044635693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3924016210665027086/posts/default/4892288632044635693'/><link rel='alternate' type='text/html' href='http://iosrefernecebook.blogspot.com/2011/06/how-to-get-current-orientation-on.html' title='How to get the current orientation on iPhone/iPad'/><author><name>Timmi</name><uri>http://www.blogger.com/profile/08747989656493505509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3924016210665027086.post-1676080194024883475</id><published>2011-06-03T01:42:00.001-07:00</published><updated>2011-06-03T01:42:23.295-07:00</updated><title type='text'>Get UDID</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;NSString *uniqueIdentifier = [[UIDevice currentDevice] uniqueIdentifier];&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iosrefernecebook.blogspot.com/feeds/1676080194024883475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://iosrefernecebook.blogspot.com/2011/06/get-udid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3924016210665027086/posts/default/1676080194024883475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3924016210665027086/posts/default/1676080194024883475'/><link rel='alternate' type='text/html' href='http://iosrefernecebook.blogspot.com/2011/06/get-udid.html' title='Get UDID'/><author><name>Timmi</name><uri>http://www.blogger.com/profile/08747989656493505509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3924016210665027086.post-5139113931656974050</id><published>2011-06-03T00:55:00.000-07:00</published><updated>2011-06-03T00:58:16.499-07:00</updated><title type='text'>Detect carrier information on iPhone</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;With the release of iOS 4, Apple introduced two new frameworks for obtaining carrier information. &lt;b&gt;CTCarrier&lt;/b&gt; offers information about the cellular provider including the carrier name, Mobile Network Code and Mobile Carrier Code. &lt;b&gt;CTTelephonyNetworkInfo&lt;/b&gt; is the channel to access information through &lt;b&gt;CTCarrier&lt;/b&gt;, this class also provides an update notifier if you need to detect changes to a changes in cellular provider information, for example, if the user swaps out there SIM card.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#import &amp;lt;CoreTelephony/CTCarrier.h&amp;gt;&lt;br /&gt;
#import &amp;lt;CoreTelephony/CTTelephonyNetworkInfo.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Setup the Network Info and create a CTCarrier object&lt;br /&gt;
CTTelephonyNetworkInfo *networkInfo = [[[CTTelephonyNetworkInfo alloc] init] autorelease];&lt;br /&gt;
CTCarrier *carrier = [networkInfo subscriberCellularProvider];&lt;br /&gt;
&lt;br /&gt;
// Get carrier name&lt;br /&gt;
NSString *carrierName = [carrier carrierName];&lt;br /&gt;
if (carrierName != nil)&lt;br /&gt;
&amp;nbsp; NSLog(@&quot;Carrier: %@&quot;, carrierName);&lt;br /&gt;
&lt;br /&gt;
// Get mobile country code&lt;br /&gt;
NSString *mcc = [carrier mobileCountryCode];&lt;br /&gt;
if (mcc != nil)&lt;br /&gt;
&amp;nbsp; NSLog(@&quot;Mobile Country Code (MCC): %@&quot;, mcc);&lt;br /&gt;
&lt;br /&gt;
// Get mobile network code&lt;br /&gt;
NSString *mnc = [carrier mobileNetworkCode];&lt;br /&gt;
if (mnc != nil)&lt;br /&gt;
&amp;nbsp; NSLog(@&quot;Mobile Network Code (MNC): %@&quot;, mnc);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iosrefernecebook.blogspot.com/feeds/5139113931656974050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://iosrefernecebook.blogspot.com/2011/06/detect-carrier-information-on-iphone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3924016210665027086/posts/default/5139113931656974050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3924016210665027086/posts/default/5139113931656974050'/><link rel='alternate' type='text/html' href='http://iosrefernecebook.blogspot.com/2011/06/detect-carrier-information-on-iphone.html' title='Detect carrier information on iPhone'/><author><name>Timmi</name><uri>http://www.blogger.com/profile/08747989656493505509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3924016210665027086.post-2480806098776728343</id><published>2011-06-03T00:28:00.000-07:00</published><updated>2011-06-03T00:28:01.375-07:00</updated><title type='text'>Get the current iPhone TimeZone</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;NSTimeZone *localTime = [NSTimeZone systemTimeZone];&lt;br /&gt;
NSLog(@&quot;Current local timezone&amp;nbsp; is&amp;nbsp; %@&quot;,[localTime name]);&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iosrefernecebook.blogspot.com/feeds/2480806098776728343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://iosrefernecebook.blogspot.com/2011/06/get-current-iphone-timezone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3924016210665027086/posts/default/2480806098776728343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3924016210665027086/posts/default/2480806098776728343'/><link rel='alternate' type='text/html' href='http://iosrefernecebook.blogspot.com/2011/06/get-current-iphone-timezone.html' title='Get the current iPhone TimeZone'/><author><name>Timmi</name><uri>http://www.blogger.com/profile/08747989656493505509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3924016210665027086.post-7814079677943162915</id><published>2011-06-03T00:15:00.001-07:00</published><updated>2011-06-03T00:15:43.897-07:00</updated><title type='text'>Get the current iPhone Language Code</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;NSString *language = [[NSLocale preferredLanguages] objectAtIndex:0];&lt;br /&gt;
NSLog(@&quot;The device&#39;s specified language is %@&quot;, language);&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iosrefernecebook.blogspot.com/feeds/7814079677943162915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://iosrefernecebook.blogspot.com/2011/06/get-current-iphone-language-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3924016210665027086/posts/default/7814079677943162915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3924016210665027086/posts/default/7814079677943162915'/><link rel='alternate' type='text/html' href='http://iosrefernecebook.blogspot.com/2011/06/get-current-iphone-language-code.html' title='Get the current iPhone Language Code'/><author><name>Timmi</name><uri>http://www.blogger.com/profile/08747989656493505509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3924016210665027086.post-3797021153639908766</id><published>2011-06-02T23:58:00.000-07:00</published><updated>2011-06-02T23:58:35.928-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="NSLog"/><title type='text'>NSLog format strings with example</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;pre&gt;//Integers: %i or %d
int int_val = -10;
NSLog(@&quot;%i, %d&quot;, int_val, int_val);&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;unsigned int uint_val = 5;
//unsigned integers use %u
NSLog(@&quot;%u&quot;, uint_val);&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;//float and double use %f
float f_val = 12.75;
NSLog(@&quot;%f&quot;, f_val);&lt;/pre&gt;&lt;pre&gt;// Hexadecimal %x or %X
int hex = 0x15;
NSLog(@&quot;%x&quot;, hex);&lt;/pre&gt;&lt;pre&gt;// Character %c
char char_val = &#39;A&#39;;
NSLog(@&quot;%c&quot;, char_val);&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iosrefernecebook.blogspot.com/feeds/3797021153639908766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://iosrefernecebook.blogspot.com/2011/06/nslog-format-strings-with-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3924016210665027086/posts/default/3797021153639908766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3924016210665027086/posts/default/3797021153639908766'/><link rel='alternate' type='text/html' href='http://iosrefernecebook.blogspot.com/2011/06/nslog-format-strings-with-example.html' title='NSLog format strings with example'/><author><name>Timmi</name><uri>http://www.blogger.com/profile/08747989656493505509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>