<?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-8501686938944171923</id><updated>2024-09-13T11:40:56.458+09:00</updated><category term="iOS開発"/><category term="InterfaceBuilder"/><category term="NSString"/><category term="NSURLConnection"/><category term="SNS"/><category term="ShareKit"/><category term="UIColor"/><category term="UIWebView"/><title type='text'>気まぐれプログラマーの卵</title><subtitle type='html'>主にiOSについての自分的メモです。間違っている箇所は多々あると思いますが、、教えていただけるとすごく喜びます(・∀・)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://programmers-egg.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8501686938944171923/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://programmers-egg.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>kumityon</name><uri>http://www.blogger.com/profile/13668816509717669299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB_5fwTQFFeqfjjWSW-PbVPk1Q5rOeAW5QWPB1oIlTJ_kcFO6adDe0CYDHWfhiFqNsVrLk6Vtnpm9MUdTlOhx2Z6QlwSe6gBh8w1W_t9SNYZgDsa7UVdjcX1GztYkQWg/s220/mini.jpg'/></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-8501686938944171923.post-2386546359049188859</id><published>2011-05-29T14:34:00.000+09:00</published><updated>2011-05-29T14:34:50.257+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS開発"/><category scheme="http://www.blogger.com/atom/ns#" term="NSURLConnection"/><title type='text'>NSURLConnectionで自己認証証明書回避について</title><content type='html'>アプリとサーバを組み合わせたシステムを開発するとき、&lt;br /&gt;
まだSSLの証明書が正式なものではないことがよくある。&lt;br /&gt;
この場合は自己認証証明書を使用するのだが、普通にNSURLConnectionとかでアクセスするとエラーで取得できない。&lt;br /&gt;
↓こんなエラー&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;Error Domain=NSURLErrorDomain Code=-1202&lt;/pre&gt;&lt;br /&gt;
そのための回避方法は以下の通り&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;- (void) httpRequest:(NSURL*)url
{
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [NSURLConnection connectionWithRequest:request delegate:self]; 
}

#pragma mark - NSURLConnectionDelegate
// 以下 SSL回避 ...
- (BOOL) connection:(NSURLConnection *)connection 
canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
{
    return [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust];
}
- (void)connection:(NSURLConnection *)connection 
didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
{
    if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]){
        [challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] 
             forAuthenticationChallenge:challenge];
    }
    [challenge.sender continueWithoutCredentialForAuthenticationChallenge:challenge];
}
&lt;/pre&gt;&lt;br /&gt;
あと、よく見かける方法はNSURLRequestをオーバーライドする方法。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;@implementation NSURLRequest(SSL)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host {
    // do some filter based off of &quot;host&quot; here
    return YES;
}
@end
/*NSURLRequestをオーバーライドする方法は正直よく分からない。。
何故かうまくいかないんだよね(´・ω・｀)*/&lt;/pre&gt;&lt;br /&gt;
ちなみに、アプリ申請時にはこのあたりはコメントアウトするなりして無効にすること。</content><link rel='replies' type='application/atom+xml' href='http://programmers-egg.blogspot.com/feeds/2386546359049188859/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://programmers-egg.blogspot.com/2011/05/nsurlconnection.html#comment-form' title='2 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8501686938944171923/posts/default/2386546359049188859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8501686938944171923/posts/default/2386546359049188859'/><link rel='alternate' type='text/html' href='http://programmers-egg.blogspot.com/2011/05/nsurlconnection.html' title='NSURLConnectionで自己認証証明書回避について'/><author><name>kumityon</name><uri>http://www.blogger.com/profile/13668816509717669299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB_5fwTQFFeqfjjWSW-PbVPk1Q5rOeAW5QWPB1oIlTJ_kcFO6adDe0CYDHWfhiFqNsVrLk6Vtnpm9MUdTlOhx2Z6QlwSe6gBh8w1W_t9SNYZgDsa7UVdjcX1GztYkQWg/s220/mini.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8501686938944171923.post-1291686842203345820</id><published>2011-05-14T10:15:00.001+09:00</published><updated>2011-05-22T22:22:04.041+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS開発"/><category scheme="http://www.blogger.com/atom/ns#" term="ShareKit"/><category scheme="http://www.blogger.com/atom/ns#" term="SNS"/><title type='text'>Twitterやfacebookを簡単に導入できるShareKitが思いのほか便利な件</title><content type='html'>Twitterとかfacebookとか自分でいちいち作るのはけっこう面倒だったんだけども、&lt;br /&gt;
いいのがあるよと教えてもらったのがこの&lt;a href=&quot;http://www.getsharekit.com/&quot;&gt;ShareKit&lt;/a&gt;&lt;br /&gt;
「３行で簡単実装できる！」が売りらしいです。&lt;br /&gt;
実装はこんな感じ&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;SHKItem *item = [SHKItem URL:[NSURL URLWithString:@&quot;http://getsharekit.com&quot;]
                                                  title:@&quot;ShareKit is Awesome!&quot;];
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
[actionSheet showFromToolbar:navigationController.toolbar];&lt;/pre&gt;これでOK（設定ファイルでいろいろ設定する必要があるけど）&lt;br /&gt;
アクションシートでTwitterだったりfacebookだったりが選択できる。&lt;br /&gt;
&lt;br /&gt;
でもこの場合だ必ずアクションシートが表示される。&lt;br /&gt;
まぁ、ソースを見ればわかるけど、&lt;br /&gt;
「このボタン押したらTwitterの投稿画面が表示したいよー」という場合は&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;SHKItem *item = [SHKItem URL:[NSURL URLWithString:@&quot;http://getsharekit.com&quot;]
                                                  title:@&quot;ShareKit is Awesome!&quot;];
[SHKTwitter performSelector:@selector(shareItem:) withObject:item];&lt;/pre&gt;とすればOK&lt;br /&gt;
facebookとかも同様にできる。。が、itemのところはtextで設定しないとデフォルトで表示させたい文字がはいらなかった。&lt;br /&gt;
また今度ちょっと時間がある時に見てみる。&lt;br /&gt;
あと、環境によっては&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;#import &amp;lt;/usr/include/objc/objc-class.h&amp;gt;&lt;/pre&gt;でエラーがでる。&lt;br /&gt;
その場合&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;#import &amp;lt;objc/objc-class.h&amp;gt;&lt;/pre&gt;とするとか&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;#import &amp;lt;objc/runtime.h&amp;gt;&lt;/pre&gt;とするといいらしい。&lt;br /&gt;
&lt;br /&gt;
※追記&lt;br /&gt;
一度表示した後閉じて、表示していたViewControllerを閉じて再度表示するとEXE_BAD_ACCESSになっていた。&lt;br /&gt;
どうやら「currentHelper」がリリースされていないのが原因らしい。&lt;br /&gt;
適当に「- (void)hideCurrentViewControllerAnimated:(BOOL)animated」の中でリリースするようにしてみたら&lt;br /&gt;
とりあえず、エラーはでなくなったけど。&lt;br /&gt;
元のコードを変えることなく、修正できないものか・・・うーん。&lt;br /&gt;
でも便利なようで不便なShareKit....</content><link rel='replies' type='application/atom+xml' href='http://programmers-egg.blogspot.com/feeds/1291686842203345820/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://programmers-egg.blogspot.com/2011/05/twitterfacebooksharekit.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8501686938944171923/posts/default/1291686842203345820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8501686938944171923/posts/default/1291686842203345820'/><link rel='alternate' type='text/html' href='http://programmers-egg.blogspot.com/2011/05/twitterfacebooksharekit.html' title='Twitterやfacebookを簡単に導入できるShareKitが思いのほか便利な件'/><author><name>kumityon</name><uri>http://www.blogger.com/profile/13668816509717669299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB_5fwTQFFeqfjjWSW-PbVPk1Q5rOeAW5QWPB1oIlTJ_kcFO6adDe0CYDHWfhiFqNsVrLk6Vtnpm9MUdTlOhx2Z6QlwSe6gBh8w1W_t9SNYZgDsa7UVdjcX1GztYkQWg/s220/mini.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8501686938944171923.post-6739662537391552021</id><published>2011-04-30T23:06:00.005+09:00</published><updated>2011-05-14T09:47:45.815+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="InterfaceBuilder"/><category scheme="http://www.blogger.com/atom/ns#" term="iOS開発"/><title type='text'>Interface Builderを使わない方法</title><content type='html'>仕事上Interface Builder（以下IB）を使うとソースコードの管理がしにくくなるのとXcode4になってからは統合されたけど3までは別アプリになってたので開発しにくい・・という事でIBは使わない方針でした。けっこうIB使わないやり方って忘れやすいので覚え書き。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
まず、ターゲット設定の&quot;Main Interface&quot;を消す&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisJUwdzkhFjIIm8IsfpvkHU4XEqsEEmLODgxwiHQ38tlcwSIABtdWvzrce6fuhkq94VhZtmJ5wyY3Ctd5_0l9Ocxrk2l2HeqcKz8cN8KPIwLH9pWLOuHTJzCUcXsYvx73PjCYCpOuslNYD/s1600/20110430224322.png&quot; imageanchor=&quot;1&quot; style=&quot;clear:left; float:left;margin-right:1em; margin-bottom:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;48&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisJUwdzkhFjIIm8IsfpvkHU4XEqsEEmLODgxwiHQ38tlcwSIABtdWvzrce6fuhkq94VhZtmJ5wyY3Ctd5_0l9Ocxrk2l2HeqcKz8cN8KPIwLH9pWLOuHTJzCUcXsYvx73PjCYCpOuslNYD/s320/20110430224322.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IBのファイル（拡張子が.xib）を削除&lt;br /&gt;
&lt;br /&gt;
AppDelegate.hの修正&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;#import &lt;UIKit/UIKit.h&gt;
@class SampleViewController;
@interface SampleAppDelegate : NSObject &lt;uiapplicationdelegate&gt; {
    UIWindow *window;
    UIViewController *viewController;
}
@property (nonatomic, retain) UIWindow *window;
@end
&lt;/pre&gt;&lt;br /&gt;
AppDelegate.mの修正&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;#import &quot;SampleAppDelegate.h&quot;
#import &quot;SampleViewController.h&quot;
@implementation SampleAppDelegate
@synthesize window;
- (BOOL)application:(UIApplication *)application 
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    viewController = [[SampleViewController alloc] init];
    window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    [window addSubview:viewController.view];
    [window makeKeyAndVisible];
    return YES;
}
- (void)dealloc
{
    [window release];
    [viewController release];
    [super dealloc];
}
@end&lt;/pre&gt;&lt;br /&gt;
main.mの修正&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;int retVal = UIApplicationMain(argc, argv, nil, @&quot;SampleAppDelegate&quot;);&lt;/pre&gt;&lt;br /&gt;
で、よし。&lt;br /&gt;
&lt;br /&gt;
IBは楽だし便利だけど、私としてはがしがしコードを書きたいな。&lt;br /&gt;
そう思うのはIB全く使ってないからかもしれないけど、、ね。</content><link rel='replies' type='application/atom+xml' href='http://programmers-egg.blogspot.com/feeds/6739662537391552021/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://programmers-egg.blogspot.com/2011/04/interface-builder.html#comment-form' title='1 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8501686938944171923/posts/default/6739662537391552021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8501686938944171923/posts/default/6739662537391552021'/><link rel='alternate' type='text/html' href='http://programmers-egg.blogspot.com/2011/04/interface-builder.html' title='Interface Builderを使わない方法'/><author><name>kumityon</name><uri>http://www.blogger.com/profile/13668816509717669299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB_5fwTQFFeqfjjWSW-PbVPk1Q5rOeAW5QWPB1oIlTJ_kcFO6adDe0CYDHWfhiFqNsVrLk6Vtnpm9MUdTlOhx2Z6QlwSe6gBh8w1W_t9SNYZgDsa7UVdjcX1GztYkQWg/s220/mini.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisJUwdzkhFjIIm8IsfpvkHU4XEqsEEmLODgxwiHQ38tlcwSIABtdWvzrce6fuhkq94VhZtmJ5wyY3Ctd5_0l9Ocxrk2l2HeqcKz8cN8KPIwLH9pWLOuHTJzCUcXsYvx73PjCYCpOuslNYD/s72-c/20110430224322.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8501686938944171923.post-7830535708026264588</id><published>2011-04-29T10:14:00.004+09:00</published><updated>2011-04-29T10:55:00.442+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS開発"/><category scheme="http://www.blogger.com/atom/ns#" term="UIWebView"/><title type='text'>UIWebViewでURL取得</title><content type='html'>UIWebView内で表示しているURLやタイトルを取得したいときは・・・&lt;br /&gt;&lt;pre class=&quot;prettyprint&quot;&gt;NSString *subject = [_webView stringByEvaluatingJavaScriptFromString:@&quot;document.title&quot;];&lt;br /&gt;NSString *currentURL =  [_webView stringByEvaluatingJavaScriptFromString:@&quot;document.URL&quot;];﻿&lt;/pre&gt;&lt;br /&gt;で、取得できる。&lt;br /&gt;なんかほかにも色々取得できそうだな。</content><link rel='replies' type='application/atom+xml' href='http://programmers-egg.blogspot.com/feeds/7830535708026264588/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://programmers-egg.blogspot.com/2011/04/uiwebviewurl.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8501686938944171923/posts/default/7830535708026264588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8501686938944171923/posts/default/7830535708026264588'/><link rel='alternate' type='text/html' href='http://programmers-egg.blogspot.com/2011/04/uiwebviewurl.html' title='UIWebViewでURL取得'/><author><name>kumityon</name><uri>http://www.blogger.com/profile/13668816509717669299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB_5fwTQFFeqfjjWSW-PbVPk1Q5rOeAW5QWPB1oIlTJ_kcFO6adDe0CYDHWfhiFqNsVrLk6Vtnpm9MUdTlOhx2Z6QlwSe6gBh8w1W_t9SNYZgDsa7UVdjcX1GztYkQWg/s220/mini.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8501686938944171923.post-1728036518700311407</id><published>2011-04-29T09:56:00.005+09:00</published><updated>2011-04-29T17:23:20.889+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS開発"/><category scheme="http://www.blogger.com/atom/ns#" term="UIColor"/><title type='text'>UIColorの色変換</title><content type='html'>UIColorであらかじめ用意されている色以外を使用する場合、ちょっとめんどくさい。&lt;br /&gt;
HTMLで使用するような指定はできないものかと調べたらすぐでてきた。&lt;br /&gt;
&lt;a href=&quot;http://www.hirano-dept.com/blog/2010/02/iphone-uicolor.html&quot; target=_blank&gt;iPhone UIColorの色変換&lt;/a&gt; from &lt;a href=&quot;http://www.hirano-dept.com/blog/&quot; target=_blank&gt;袖触れ合うも多少の縁&lt;/a&gt;&lt;br /&gt;
上記サイトより引用&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;#define HEXCOLOR(c) [UIColor colorWithRed:((c&gt;&gt;16)&amp;0xFF)/255.0 \
green:((c&gt;&gt;8)&amp;0xFF)/255.0 \
blue:(c&amp;0xFF)/255.0 \
alpha:1.0];&lt;/pre&gt;で、使うときは&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;UIColor *color = HEXCOLOR(0xff00ff);&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
これは便利！&lt;br /&gt;
Prefix.pchかなんかに定義しておくとどこでも使えて便利！</content><link rel='replies' type='application/atom+xml' href='http://programmers-egg.blogspot.com/feeds/1728036518700311407/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://programmers-egg.blogspot.com/2011/04/uicolor.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8501686938944171923/posts/default/1728036518700311407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8501686938944171923/posts/default/1728036518700311407'/><link rel='alternate' type='text/html' href='http://programmers-egg.blogspot.com/2011/04/uicolor.html' title='UIColorの色変換'/><author><name>kumityon</name><uri>http://www.blogger.com/profile/13668816509717669299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB_5fwTQFFeqfjjWSW-PbVPk1Q5rOeAW5QWPB1oIlTJ_kcFO6adDe0CYDHWfhiFqNsVrLk6Vtnpm9MUdTlOhx2Z6QlwSe6gBh8w1W_t9SNYZgDsa7UVdjcX1GztYkQWg/s220/mini.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8501686938944171923.post-8137576458950763902</id><published>2011-04-29T09:20:00.005+09:00</published><updated>2011-04-29T09:48:09.611+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS開発"/><category scheme="http://www.blogger.com/atom/ns#" term="NSString"/><title type='text'>文字列の高さを取得する</title><content type='html'>&lt;pre class=&quot;prettyprint&quot;&gt;//取得したい文字列&lt;br /&gt;NSString *text = @&quot;ここにテキストここにテキストここにテキストここにテキストここにテキスト&quot;;&lt;br /&gt;//最大の表示領域のCGSize&lt;br /&gt;CGSize maxSize = CGSizeMake(300.0, 1000.0);&lt;br /&gt;//使用するUIFont&lt;br /&gt;UIFont* font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];&lt;br /&gt;&lt;br /&gt;//文字列のCGSizeを取得する&lt;br /&gt;CGSize size = [ text sizeWithFont: font&lt;br /&gt;               constrainedToSize: maxSize&lt;br /&gt;                   lineBreakMode: UILineBreakModeCharacterWrap];&lt;br /&gt;&lt;br /&gt;NSLog(@&quot; width: %f  , height : %f&quot;, size.width, size.height);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;可変文字列をセルに全文表示したい時など、UILabelを使用する場合に便利。&lt;br /&gt;UITextViewだとあまり気にはしないけど・・・UITextViewのスクロールを使いたくないときとかいいかな。</content><link rel='replies' type='application/atom+xml' href='http://programmers-egg.blogspot.com/feeds/8137576458950763902/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://programmers-egg.blogspot.com/2011/04/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8501686938944171923/posts/default/8137576458950763902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8501686938944171923/posts/default/8137576458950763902'/><link rel='alternate' type='text/html' href='http://programmers-egg.blogspot.com/2011/04/blog-post.html' title='文字列の高さを取得する'/><author><name>kumityon</name><uri>http://www.blogger.com/profile/13668816509717669299</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB_5fwTQFFeqfjjWSW-PbVPk1Q5rOeAW5QWPB1oIlTJ_kcFO6adDe0CYDHWfhiFqNsVrLk6Vtnpm9MUdTlOhx2Z6QlwSe6gBh8w1W_t9SNYZgDsa7UVdjcX1GztYkQWg/s220/mini.jpg'/></author><thr:total>0</thr:total></entry></feed>