{"id":2092,"date":"2015-01-29T09:55:21","date_gmt":"2015-01-29T00:55:21","guid":{"rendered":"http:\/\/www.sria.co.jp\/blog\/?p=2092"},"modified":"2015-01-29T09:54:46","modified_gmt":"2015-01-29T00:54:46","slug":"talking-about-implement-uitableviewcontroller-using-uitableview-and-hooked","status":"publish","type":"post","link":"https:\/\/www.sria.co.jp\/blog\/2015\/01\/talking-about-implement-uitableviewcontroller-using-uitableview-and-hooked\/","title":{"rendered":"UITableView\u3092UITableViewController\u4f7f\u308f\u305a\u306b\u5b9f\u88c5\u3057\u3066\u30cf\u30de\u3063\u305f\u8a71"},"content":{"rendered":"<p>\u6700\u8fd1\u4e45\u3005\u306biOS\u306e\u30a2\u30d7\u30ea\u3092\u6539\u4fee\u3057\u3066\u308a\u65b0\u898f\u306b\u4f5c\u3063\u305f\u308a\u3057\u3066\u307e\u3059\u3002<br \/>\n\u305d\u3053\u3067\u30bf\u30a4\u30c8\u30eb\u306e\u901a\u308a\u30cf\u30de\u3063\u305f\u306e\u3067\u30e1\u30e2\u66f8\u304d\u7a0b\u5ea6\u306b\u3002\u3002\u3002<\/p>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<p>UITableView\u3092\u3044\u308d\u3044\u308d\u4e8b\u60c5\u304c\u3042\u3063\u3066\u3001UITableViewController\u304b\u3089\u7d99\u627f\u305b\u305a<br \/>\nUIViewController\u30d9\u30fc\u30b9\u3067\u305d\u3053\u306b\u8f09\u305b\u308b\u5f62\u3067\u5b9f\u88c5\u3057\u3066\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3067\u3001\u5404\u30bb\u30eb\u3092\u8a2d\u5b9a\u3059\u308b\u300ccellForRowAtIndexPath\u300d\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8f09\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:objc decode:true\">- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {\r\n    \r\n    static NSString *CellIdentifier = @\"Cell\";\r\n    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];\r\n    \r\n    if (cell == nil) {\r\n        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];\r\n    }\r\n    \r\n    cell.textLabel.text = @\"hogehoge\";\r\n    \r\n    return cell;\r\n}<\/pre>\n<p>\u307e\u3041\u3088\u304f\u3042\u308b\u30d1\u30bf\u30fc\u30f3\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u307e\u307e\u9069\u5f53\u306a\u6570\u306e\u30bb\u30eb\u3092\u51fa\u529b\u3057\u3088\u3046\u3068\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<blockquote><p>unable to dequeue a cell with identifier Cell &#8211; must register a nib or a class for the identifier or connect a prototype cell in a storyboard<\/p>\n<p>&nbsp;<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>\u898b\u305f\u3053\u3068\u306a\u3044\u30a8\u30e9\u30fc\u3060\u3063\u305f\u306e\u3067\u3001\u8abf\u3079\u3066\u307f\u308b\u3068deque\u3057\u3066\u308b\u3068\u3053\u304c\u307e\u305a\u3044\u3063\u307d\u3044\u3068\u3002<br \/>\n\u306a\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4fee\u6b63<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:objc decode:true \">UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];\r\n\r\n\u2193\r\n\r\nUITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];<\/pre>\n<p>&nbsp;<\/p>\n<p>\u4eca\u56de\u3001Storyboard\u3092\u4f7f\u7528\u3057\u306a\u3044\u958b\u767a\u3092\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u304a\u305d\u3089\u304f\u305d\u308c\u304c\u539f\u56e0\u3068\u8003\u3048\u3089\u308c\u307e\u3059\u3002<br \/>\n\u3042\u3068\u4f7f\u3063\u305f\u3053\u3068\u306a\u3044\u3051\u3069\u3001forIndexPath\u3092\u6307\u5b9a\u3059\u308b\u306e\u306fStaticCell\u4f7f\u3046\u305f\u3081\u306e\u3082\u306e\u306a\u306e\u304b\u3082\u3068\u601d\u3063\u305f\u308a\u3002\u3002\u3002<br \/>\niOS5\u306e\u9803\u304c\u4e00\u756a\u30a2\u30d7\u30ea\u958b\u767a\u3092\u3057\u3066\u305f\u3088\u3046\u306a\u6c17\u304c\u3059\u308b\u306e\u3067\u3001\u3044\u308d\u3044\u308d\u52c9\u5f37\u304c\u5fc5\u8981\u3068\u75db\u611f\u3057\u3066\u3044\u307e\u3059(^_^;)<\/p>\n<p>&nbsp;<\/p>\n<p>\u4ee5\u4e0a\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u4e45\u3005\u306biOS\u306e\u30a2\u30d7\u30ea\u3092\u6539\u4fee\u3057\u3066\u308a\u65b0\u898f\u306b\u4f5c\u3063\u305f\u308a\u3057\u3066\u307e\u3059\u3002 \u305d\u3053\u3067\u30bf\u30a4\u30c8\u30eb\u306e\u901a\u308a\u30cf\u30de\u3063\u305f\u306e\u3067\u30e1\u30e2\u66f8\u304d\u7a0b\u5ea6\u306b\u3002\u3002\u3002<\/p>\n","protected":false},"author":5,"featured_media":232,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[15,8],"tags":[61,101],"_links":{"self":[{"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/posts\/2092"}],"collection":[{"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/comments?post=2092"}],"version-history":[{"count":6,"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/posts\/2092\/revisions"}],"predecessor-version":[{"id":2099,"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/posts\/2092\/revisions\/2099"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/media\/232"}],"wp:attachment":[{"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/media?parent=2092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/categories?post=2092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sria.co.jp\/blog\/wp-json\/wp\/v2\/tags?post=2092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}