{"id":658,"date":"2010-12-01T12:19:41","date_gmt":"2010-12-01T03:19:41","guid":{"rendered":"http:\/\/yamazon.org\/?p=658"},"modified":"2010-12-01T12:19:41","modified_gmt":"2010-12-01T03:19:41","slug":"5nsarray%e3%82%92uitableview%e3%81%ab%e3%82%bb%e3%83%83%e3%83%88%e3%81%97%e3%81%a6","status":"publish","type":"post","link":"https:\/\/apr20.net\/?p=658","title":{"rendered":"[5]:\u914d\u5217\u30c7\u30fc\u30bf\u3092\u4f7f\u3063\u3066\u3001UITableView\u3068\u9023\u643a\u3055\u305b\u308b"},"content":{"rendered":"<p>\u4eca\u56de\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306f\u3001\u914d\u5217\u30c7\u30fc\u30bf\u3092\u4f7f\u3063\u3066\u3001UITableView\u3068\u9023\u643a\u3055\u305b\u308b\u65b9\u6cd5\u3067\u3059\u3002SQL\u3084XML\u306e\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3055\u305b\u308b\u305f\u3081\u306e\u8981\u7d20\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u4eca\u56de\u306f\u300c\u30d5\u30eb\u30fc\u30c4\u300d\u3092\u30c6\u30fc\u30de\u306b\u3001\u540d\u79f0\u306e\u307b\u304b\u3001\u3044\u304f\u3064\u304b\u306e\u8ffd\u52a0\u60c5\u5831\u3092\u3082\u3064\u300c\u30d5\u30eb\u30fc\u30c4\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u914d\u5217\u300d\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002UITabeleView\u306b\u5404\u30d5\u30eb\u30fc\u30c4\u306e\u540d\u79f0\u3092\u8868\u793a\u3055\u305b\u3001\u540d\u79f0\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u308b\u3068view\u304c\u9077\u79fb\u3057\u3001\u305d\u306e\u30d5\u30eb\u30fc\u30c4\u306e\u8a73\u7d30\u60c5\u5831\u3092\u8868\u793a\u3055\u305b\u307e\u3059\u3002<\/p>\n<blockquote><p>\u4eca\u56de\u306e\u8a18\u4e8b\u306f\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u65e2\u8aad\u306e\u65b9\u3092\u60f3\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul style=\"padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; margin: 0px;\">\n<li style=\"padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 20px; list-style-position: inside; margin: 0px;\"><a style=\"color: #2970a6; text-decoration: none;\" href=\"http:\/\/yamazon.org\/iphone-app-develop-tips\/631\">[4]:View\u9593\u3067\u306e\u79fb\u52d5\u306b\u3064\u3044\u3066<\/a><\/li>\n<li style=\"padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 20px; list-style-position: inside; margin: 0px;\"><a style=\"color: #2970a6; text-decoration: none;\" href=\"http:\/\/yamazon.org\/iphone-app-develop-tips\/601\">[3]:Interface Builder \u3068 Xcode \u3092\u63a5\u7d9a\u3059\u308b\u65b9\u6cd5<\/a><\/li>\n<li style=\"padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 20px; list-style-position: inside; margin: 0px;\"><a style=\"color: #2970a6; text-decoration: none;\" href=\"http:\/\/yamazon.org\/iphone-app-develop-tips\/601\"><\/a><a style=\"color: #2970a6; text-decoration: none;\" href=\"http:\/\/yamazon.org\/iphone-app-develop-tips\/585\">[2]:Interface Builder \u306e\u307f\u3067 Hello World<\/a><\/li>\n<\/ul>\n<\/blockquote>\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding: 0px;\"><strong>\u4eca\u56de\u5b66\u3076\u3053\u3068\uff1a<\/strong><\/p>\n<ul style=\"padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; margin: 0px;\">\n<li style=\"padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 20px; list-style-position: inside; margin: 0px;\"><span style=\"color: #008000;\">Navigation-Based Application \u306e\u65b0\u898f\u4f5c\u6210<\/span><\/li>\n<li style=\"padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 20px; list-style-position: inside; margin: 0px;\"><span style=\"color: #008000;\">\u30d5\u30eb\u30fc\u30c4Class\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u4f5c\u6210<\/span><\/li>\n<li style=\"padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 20px; list-style-position: inside; margin: 0px;\"><span style=\"color: #008000;\">NSArray \u914d\u5217\u3092\u4f5c\u6210\u3057\u3001\u66f8\u304d\u8fbc\u3080<\/span><\/li>\n<li style=\"padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 20px; list-style-position: inside; margin: 0px;\"><span style=\"color: #008000;\">\u65b0\u898f\u30d3\u30e5\u30fc\u306e\u8ffd\u52a0<\/span><\/li>\n<li style=\"padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 20px; list-style-position: inside; margin: 0px;\"><span style=\"color: #008000;\">view\u3068\u30b3\u30fc\u30c9\u3092\u63a5\u7d9a\u3059\u308b<\/span><\/li>\n<li style=\"padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 20px; list-style-position: inside; margin: 0px;\"><span style=\"color: #008000;\">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30c7\u30fc\u30bf\u3092UITableView\u306b\u66f8\u304d\u8fbc\u3080<\/span><\/li>\n<li style=\"padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 20px; list-style-position: inside; margin: 0px;\"><span style=\"color: #008000;\">view\u3092\u9077\u79fb\u3055\u305b\u3001\u9078\u629e\u3055\u308c\u305f\u884c\u306b\u57fa\u3065\u304f\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3055\u305b\u308b<\/span><\/li>\n<\/ul>\n<p><!--more--><br \/>\nXCode\u3092\u8d77\u52d5\u3057\u3001<strong>Navigation-Based Application <\/strong>\u3092\u4f7f\u3063\u3066\u3001\u65b0\u898f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002Use Core Data..\u306e\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u306f\u30c1\u30a7\u30c3\u30af\u3057\u307e\u305b\u3093\u3002<\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u306f\u300cFruit\u300d\u3068\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-664\" title=\"05-1\" src=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-1-300x246.jpg\" alt=\"05-1\" width=\"300\" height=\"246\" \/><\/a><\/p>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5185\u3067\u4f7f\u308f\u308c\u308bFruit\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>XCode\u4e0a\u304b\u3089\u3000\u30d5\u30a1\u30a4\u30eb \uff1e \u65b0\u898f\u30d5\u30a1\u30a4\u30eb \u3092\u30af\u30ea\u30c3\u30af\u3057\u3001NSObject \u306e\u30b5\u30d6\u30af\u30e9\u30b9\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u56f3\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><a href=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-665\" title=\"05-2\" src=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-2-300x243.jpg\" alt=\"05-2\" width=\"300\" height=\"243\" \/><\/a><\/p>\n<p>\u65b0\u898f\u30b5\u30d6\u30af\u30e9\u30b9\u306e\u540d\u524d\u306f\u300cFruit.m\u300d\u3068\u3057\u307e\u3059\u3002\u540c\u6642\u306b\u201dFruit.h\u201d\u3082\u4f5c\u6210\u304c\u30c1\u30a7\u30c3\u30af\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u3001\u5b8c\u4e86\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u3001\u4f5c\u6210\u3057\u305fFruit\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u3053\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5404\u30d5\u30eb\u30fc\u30c4\u306f\u3001\u540d\u79f0\u3068\u8a73\u7d30\u60c5\u5831\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><strong>Fruit.h<\/strong> \u3092\u958b\u304d\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n<blockquote>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12e1b;\"><span style=\"color: #78492a;\">#import <\/span>&lt;Foundation\/Foundation.h&gt;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">@interface<\/span> Fruit : NSObject {<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span><span style=\"color: #703daa;\">NSString<\/span> *name;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span><span style=\"color: #703daa;\">NSString<\/span> *description;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">}<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #bb2da2;\">@property<span style=\"color: #000000;\">(<\/span>nonatomic<span style=\"color: #000000;\">,<\/span>copy<span style=\"color: #000000;\">) NSString *name;<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">@property<\/span>(<span style=\"color: #bb2da2;\">nonatomic<\/span>,<span style=\"color: #bb2da2;\">copy<\/span>) NSString *description;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">-(<span style=\"color: #bb2da2;\">id<\/span>)initWithName(<span style=\"color: #703daa;\">NSString<\/span>*)n description:(<span style=\"color: #703daa;\">NSString<\/span> *)desc;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #bb2da2;\">@end<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #bb2da2;\">\n<\/blockquote>\n<p>\u30d5\u30eb\u30fc\u30c4\u3092\u8868\u73fe\u3059\u308b\u306e\u306b\u5fc5\u8981\u306a\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u898b\u6163\u308c\u306a\u3044\u4e00\u884c\u304c\u3042\u308a\u307e\u3059\u306d\u3002<\/p>\n<blockquote>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">-(<span style=\"color: #bb2da2;\">id<\/span>)initWithName(<span style=\"color: #703daa;\">NSString<\/span>*)n description:(<span style=\"color: #703daa;\">NSString<\/span> *)desc;<\/p>\n<\/blockquote>\n<p>\u3053\u306e\u884c\u306f\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u95a2\u6570\u306f\u3001\u679c\u7269\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u521d\u671f\u5316\u3059\u308b\u305f\u3081\u306b\u547c\u3073\u51fa\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3059\u3079\u3066\u306eNSobject\u306finit\u30e1\u30bd\u30c3\u30c9\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u72ec\u81ea\u306b\u8a2d\u5b9a\u3057\u305f\u3044\u6642\u306f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u4f5c\u6210\u3055\u308c\u308b\u6642\u306b\u3001\u540d\u524d\u3084\u8a73\u7d30\u60c5\u5831\u3092\u6e21\u3059\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<p><strong>Fruit.m <\/strong>\u3092\u958b\u304d\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7de8\u96c6\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<blockquote>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12e1b;\"><span style=\"color: #78492a;\">#import <\/span>&#8220;Fruit.h&#8221;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #bb2da2;\">@implementation<span style=\"color: #000000;\"> Fruit<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">@synthesize<\/span> name,description;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">-(<span style=\"color: #bb2da2;\">id<\/span>)initWithName:(<span style=\"color: #703daa;\">NSString<\/span>*)n description:(<span style=\"color: #703daa;\">NSString<\/span>*)desc {<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span><span style=\"color: #bb2da2;\">self<\/span>.<span style=\"color: #703daa;\">name<\/span> = n;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span><span style=\"color: #bb2da2;\">self<\/span>.description = desc;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #bb2da2;\"><span style=\"color: #000000;\"><span style=\"white-space: pre;\"> <\/span><\/span>return<span style=\"color: #000000;\"> <\/span>self<span style=\"color: #000000;\">;<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">}<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #bb2da2;\">@end<\/p>\n<\/blockquote>\n<p>\u3053\u3053\u3067\u306f\u3001initWithName\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u6e21\u3055\u308c\u308b\u5f15\u6570\u306e\u540d\u524d\u3068\u8a73\u7d30\u60c5\u5831\u3092\u30ed\u30fc\u30ab\u30eb\u30b3\u30d4\u30fc\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u91cd\u8981\u306a\u306e\u306f\u3001\u300creturn self\u300d\u306e\u884c\u3067\u3059\u3002\u3053\u308c\u306f\u3001\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3068\u3057\u3066\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u975e\u5e38\u306b\u91cd\u8981\u3067\u3059\u3002\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001\u3053\u306e\u95a2\u6570\u304c\u3001\u65b0\u305f\u306b\u4f5c\u6210\u3055\u308c\u305f\u679c\u7269\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8fd4\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002(?)<\/p>\n<p>\u6b21\u306f\u3001\u30e1\u30a4\u30f3view\u306e\u30bf\u30a4\u30c8\u30eb\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002\u3053\u306e\u8a2d\u5b9a\u306fview\u9593\u3092\u79fb\u52d5\u3057\u3001\u623b\u308b\u30dc\u30bf\u30f3\u3092\u8a2d\u7f6e\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u5fc5\u305a\u6307\u5b9a\u3057\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<p><strong>RootViewController.m <\/strong>\u3092\u958b\u304d\u3001<strong>viewDidLoad<\/strong>\u30e1\u30bd\u30c3\u30c9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<blockquote>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12e1b;\"><span style=\"color: #78492a;\">#import <\/span>&#8220;RootViewController.h&#8221;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12e1b;\"><span style=\"color: #78492a;\">#import <\/span>&#8220;FruitAppDelegate.h&#8221;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12e1b;\"><span style=\"color: #78492a;\">#import <\/span>&#8220;Fruit.h&#8221;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">@implementation<\/span> RootViewController<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #bb2da2;\">@synthesize<span style=\"color: #000000;\"> fruitView;<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #78492a;\">#pragma mark &#8211;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #78492a;\">#pragma mark View lifecycle<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">&#8211; (<span style=\"color: #bb2da2;\">void<\/span>)viewDidLoad {<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #3d1e81;\"><span style=\"color: #000000;\"> [<\/span><span style=\"color: #bb2da2;\">super<\/span><span style=\"color: #000000;\"> <\/span>viewDidLoad<span style=\"color: #000000;\">];<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400;\"><span style=\"color: #000000;\"> <\/span>\/\/ Uncomment the following line to display an Edit button in the navigation bar for this view controller.<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400;\"><span style=\"color: #000000;\"> <\/span>\/\/ self.navigationItem.rightBarButtonItem = self.editButtonItem;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12e1b;\"><span style=\"color: #000000;\"><span style=\"white-space: pre;\"> <\/span><\/span><span style=\"color: #bb2da2;\">self<\/span><span style=\"color: #000000;\">.<\/span><span style=\"color: #703daa;\">title<\/span><span style=\"color: #000000;\"> = <\/span>@&#8221;<span style=\"font: 11.0px 'Hiragino Kaku Gothic ProN';\">\u679c\u7269\u30ea\u30b9\u30c8<\/span>&#8220;<span style=\"color: #000000;\">;<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">}<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<\/blockquote>\n<p>\u3053\u308c\u3067\u3001RootViewController\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30bf\u30a4\u30c8\u30eb\u304c\u300c\u679c\u7269\u30ea\u30b9\u30c8\u300d\u3068\u8a2d\u5b9a\u3055\u308c\u307e\u3057\u305f\u3002#import \u6587\u3068 @synthesize \u6587\u306e\u8ffd\u52a0\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u6b21\u306b\u3001\u679c\u7269\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u914d\u5217\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<strong>FruitAppDelegate.h <\/strong>\u3092\u958b\u304d\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<blockquote>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12e1b;\"><span style=\"color: #78492a;\">#import <\/span>&lt;UIKit\/UIKit.h&gt;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">@interface<\/span> FruitAppDelegate : NSObject &lt;UIApplicationDelegate&gt; {<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #703daa;\"><span style=\"color: #000000;\"> <\/span>UIWindow<span style=\"color: #000000;\"> *<\/span><span style=\"color: #4e8187;\">window<\/span><span style=\"color: #000000;\">;<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #703daa;\"><span style=\"color: #000000;\"> <\/span>UINavigationController<span style=\"color: #000000;\"> *<\/span><span style=\"color: #4e8187;\">navigationController<\/span><span style=\"color: #000000;\">;<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\"><span style=\"white-space: pre;\"> <\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #703daa;\"><span style=\"color: #000000;\"><span style=\"white-space: pre;\"> <\/span><\/span>NSMutableArray<span style=\"color: #000000;\"> *fruits;<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">}<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #bb2da2;\">@property<span style=\"color: #000000;\"> (<\/span>nonatomic<span style=\"color: #000000;\">, <\/span>retain<span style=\"color: #000000;\">) <\/span>IBOutlet<span style=\"color: #000000;\"> UIWindow *window;<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">@property<\/span> (<span style=\"color: #bb2da2;\">nonatomic<\/span>, <span style=\"color: #bb2da2;\">retain<\/span>) <span style=\"color: #bb2da2;\">IBOutlet<\/span> UINavigationController *navigationController;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">@property<\/span> (<span style=\"color: #bb2da2;\">nonatomic<\/span>, <span style=\"color: #bb2da2;\">retain<\/span>) NSMutableArray *fruits;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #bb2da2;\">@end<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<\/blockquote>\n<p>\u3053\u3053\u3067\u52a0\u3048\u3066\u3044\u308b\u3059\u3079\u3066\u304c\u3001NSMutableArray\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3067\u3059\u3002<\/p>\n<p>NSArray\u3067\u306f\u306a\u304f\u3001NSMutableArray\u3092\u4f7f\u3063\u305f\u306e\u306f\u3001\u5f8c\u8005\u306e\u65b9\u304c\u3088\u308a\u67d4\u8edf\u306a\u3044\u304f\u3064\u304b\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u6301\u3063\u3066\u3044\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n<p><strong>FruitAppDelegate.m <\/strong>\u3092\u958b\u304d\u3001\uff20synthesize \u884c\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306b\u3088\u308a\u3001\u4ed6\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u3001\u679c\u7269\u306e\u914d\u5217\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u307e\u305f\u3001Fruit.h\u306eimport\u6587\u3092\u542b\u3081\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<blockquote>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12e1b;\"><span style=\"color: #78492a;\">#import <\/span>&#8220;FruitAppDelegate.h&#8221;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12e1b;\"><span style=\"color: #78492a;\">#import <\/span>&#8220;RootViewController.h&#8221;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12e1b;\"><span style=\"color: #78492a;\">#import <\/span>&#8220;Fruit.h&#8221;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">@implementation<\/span> FruitAppDelegate<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #bb2da2;\">@synthesize<span style=\"color: #000000;\"> window;<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">@synthesize<\/span> navigationController;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #bb2da2;\">@synthesize<span style=\"color: #000000;\"> fruits;<\/span><\/p>\n<\/blockquote>\n<div><strong>applicationDidFinishLaunching <\/strong>\u30e1\u30bd\u30c3\u30c9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7de8\u96c6\u3057\u307e\u3059\u3002<\/div>\n<div>\n<blockquote>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">&#8211; (<span style=\"color: #bb2da2;\">BOOL<\/span>)application:(<span style=\"color: #703daa;\">UIApplication<\/span> *)application didFinishLaunchingWithOptions:(<span style=\"color: #703daa;\">NSDictionary<\/span> *)launchOptions {<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #31595e;\"><span style=\"color: #000000;\"><span style=\"white-space: pre;\"> <\/span><\/span><span style=\"color: #4e8187;\">Fruit<\/span><span style=\"color: #000000;\"> *apple = [[<\/span><span style=\"color: #4e8187;\">Fruit<\/span><span style=\"color: #000000;\"> <\/span><span style=\"color: #3d1e81;\">alloc<\/span><span style=\"color: #000000;\">] <\/span>initWithName<span style=\"color: #000000;\">:<\/span><span style=\"color: #d12e1b;\">@&#8221;<\/span><span style=\"font: 11.0px 'Hiragino Kaku Gothic ProN'; color: #d12e1b;\">\u308a\u3093\u3054<\/span><span style=\"color: #d12e1b;\">&#8220;<\/span><span style=\"color: #000000;\"> <\/span>description<span style=\"color: #000000;\">:<\/span><span style=\"color: #d12e1b;\">@&#8221;<\/span><span style=\"font: 11.0px 'Hiragino Kaku Gothic ProN'; color: #d12e1b;\">\u8d64\u304f\u3066\u7f8e\u5473\u3057\u3044<\/span><span style=\"color: #d12e1b;\">&#8220;<\/span><span style=\"color: #000000;\">];<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12e1b;\"><span style=\"color: #000000;\"><span style=\"white-space: pre;\"> <\/span><\/span><span style=\"color: #4e8187;\">Fruit<\/span><span style=\"color: #000000;\"> *orange = [[<\/span><span style=\"color: #4e8187;\">Fruit<\/span><span style=\"color: #000000;\"> <\/span><span style=\"color: #3d1e81;\">alloc<\/span><span style=\"color: #000000;\">] <\/span><span style=\"color: #31595e;\">initWithName<\/span><span style=\"color: #000000;\">:<\/span>@&#8221;<span style=\"font: 11.0px 'Hiragino Kaku Gothic ProN';\">\u30aa\u30ec\u30f3\u30b8<\/span>&#8220;<span style=\"color: #000000;\"> <\/span><span style=\"color: #31595e;\">description<\/span><span style=\"color: #000000;\">:<\/span>@&#8221;<span style=\"font: 11.0px 'Hiragino Kaku Gothic ProN';\">\u65b0\u9bae\u306a\u30aa\u30ec\u30f3\u30b8\u30b8\u30e5\u30fc\u30b9\u304c\u51fa\u6765\u307e\u3059<\/span>&#8220;<span style=\"color: #000000;\">];<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #31595e;\"><span style=\"color: #000000;\"><span style=\"white-space: pre;\"> <\/span><\/span><span style=\"color: #4e8187;\">Fruit<\/span><span style=\"color: #000000;\"> *melon = [[<\/span><span style=\"color: #4e8187;\">Fruit<\/span><span style=\"color: #000000;\"> <\/span><span style=\"color: #3d1e81;\">alloc<\/span><span style=\"color: #000000;\">] <\/span>initWithName<span style=\"color: #000000;\">:<\/span><span style=\"color: #d12e1b;\">@&#8221;<\/span><span style=\"font: 11.0px 'Hiragino Kaku Gothic ProN'; color: #d12e1b;\">\u30e1\u30ed\u30f3<\/span><span style=\"color: #d12e1b;\">&#8220;<\/span><span style=\"color: #000000;\"> <\/span>description<span style=\"color: #000000;\">:<\/span><span style=\"color: #d12e1b;\">@&#8221;<\/span><span style=\"font: 11.0px 'Hiragino Kaku Gothic ProN'; color: #d12e1b;\">\u5927\u304d\u304f\u3066\u3001\u5b50\u4f9b\u305f\u3061\u306b\u3082\u5927\u4eba\u6c17<\/span><span style=\"color: #d12e1b;\">&#8220;<\/span><span style=\"color: #000000;\">];<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\"><span style=\"white-space: pre;\"> <\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span><span style=\"color: #bb2da2;\">self<\/span>.<span style=\"color: #4e8187;\">fruits<\/span> = [[<span style=\"color: #703daa;\">NSMutableArray<\/span> <span style=\"color: #3d1e81;\">alloc<\/span>] <span style=\"color: #3d1e81;\">initWithObjects<\/span>:apple,orange,melon,<span style=\"color: #bb2da2;\">nil<\/span>];<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\"><span style=\"white-space: pre;\"> <\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400;\"><span style=\"color: #000000;\"> <\/span>\/\/ Override point for customization after application launch.<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400;\"><span style=\"color: #000000;\"> <\/span>\/\/ Add the navigation controller&#8217;s view to the window and display.<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #4e8187;\"><span style=\"color: #000000;\"> [<\/span>window<span style=\"color: #000000;\"> <\/span><span style=\"color: #3d1e81;\">addSubview<\/span><span style=\"color: #000000;\">:<\/span>navigationController<span style=\"color: #000000;\">.<\/span><span style=\"color: #3d1e81;\">view<\/span><span style=\"color: #000000;\">];<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #3d1e81;\"><span style=\"color: #000000;\"> [<\/span><span style=\"color: #4e8187;\">window<\/span><span style=\"color: #000000;\"> <\/span>makeKeyAndVisible<span style=\"color: #000000;\">];<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #bb2da2;\"><span style=\"color: #000000;\"> <\/span>return<span style=\"color: #000000;\"> <\/span>YES<span style=\"color: #000000;\">;<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">}<\/p>\n<\/blockquote>\n<\/div>\n<div>\u3053\u3053\u3067\u8a18\u5165\u3057\u305f\u30b3\u30fc\u30c9\u306f\u3001\u6700\u521d\u306e Fruit \u304b\u3089\u59cb\u307e\u308b\u4e09\u884c\u3067\u30d5\u30eb\u30fc\u30c4\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u65b0\u3057\u3044\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<strong>init <\/strong>\u3067\u306f\u306a\u304f\u3001<strong><strong>initWithName <\/strong><\/strong>\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306b\u3088\u3063\u3066\u3001\u5404\u30d5\u30eb\u30fc\u30c4\u306e\u540d\u79f0\u3068\u8a73\u7d30\u60c5\u5831\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002<\/div>\n<div>\u305d\u306e\u6b21\u306e\u3001<\/div>\n<blockquote>\n<div><span style=\"color: #bb2da2;\">self<\/span>.<span style=\"color: #4e8187;\">fruits<\/span> = [[<span style=\"color: #703daa;\">NSMutableArray<\/span> <span style=\"color: #3d1e81;\">alloc<\/span>]<span style=\"color: #3d1e81;\">initWithObjects<\/span>:apple,orange,melon,<span style=\"color: #bb2da2;\">nil<\/span>];<\/div>\n<\/blockquote>\n<div>\u5148\u307b\u3069\u4f5c\u6210\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089\u914d\u5217\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002\u6700\u5f8c\u306e\u5f15\u6570\u306e <strong>nil <\/strong>\u304c\u91cd\u8981\u3067\u3001\u3053\u308c\u3092\u5fd8\u308c\u308b\u3068\u52d5\u4f5c\u3057\u307e\u305b\u3093\u3002<\/div>\n<p>\u305d\u308c\u3067\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u30d5\u30eb\u30fc\u30c4\u540d\u3092\u9078\u629e\u3057\u305f\u6642\u306b\u8868\u793a\u3055\u308c\u308bview\u3092\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5185\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308bxib\u30d5\u30a1\u30a4\u30eb\u306e\u3044\u305a\u308c\u304b\u3092\u9078\u629e\u3057\u3001<strong>Interface Builder <\/strong>\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-669\" title=\"05-3\" src=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-3-300x224.jpg\" alt=\"05-3\" width=\"300\" height=\"224\" \/><\/a>\u30e1\u30cb\u30e5\u30fc\u304b\u3089File &gt; New.. \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-4.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-670\" title=\"05-4\" src=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-4-300x196.jpg\" alt=\"05-4\" width=\"300\" height=\"196\" \/><\/a>iOS \u306e\u4e2d\u306eview \u3092\u9078\u629e\u3057 Choose\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3046\u3059\u308b\u3068\u7a7a\u306eview\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002\u305d\u3053\u306b\u8a73\u7d30\u60c5\u5831\u3092\u8868\u793a\u3055\u305b\u308b\u305f\u3081\u306e\u30c6\u30ad\u30b9\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u914d\u7f6e\u3057\u307e\u3059\u3002UITextField\u3067\u306f\u306a\u304f\u3001UITextView\u3092\u914d\u7f6e\u3057\u307e\u3059\u3002UITextView\u306f\u3001\u30de\u30eb\u30c1\u30e9\u30a4\u30f3\u3067\u3059\u306e\u3067\u3001\u8907\u6570\u884c\u306e\u30c6\u30ad\u30b9\u30c8\u3092\u8868\u793a\u3059\u308b\u306e\u306b\u512a\u308c\u3066\u3044\u307e\u3059\u3002\u30e9\u30a4\u30d6\u30e9\u30ea\u304b\u3089UITextView\u3092\u9078\u629e\u3057\u3001view\u306b\u914d\u7f6e\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><a href=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-5.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-671\" title=\"05-5\" src=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-5-196x300.jpg\" alt=\"05-5\" width=\"196\" height=\"300\" \/><\/a><\/p>\n<p>\u4e0a\u8a18\u306e\u56f3\u306e\u72b6\u614b\u3067\u4fdd\u5b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4fdd\u5b58\u306e\u969b\u306e\u6ce8\u610f\u70b9\u3068\u3057\u3066\u306f\u3001\u73fe\u5728\u4f5c\u6210\u4e2d\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4e2d\u306b\u4fdd\u5b58\u3059\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002\u540d\u524d\u306f<strong>FruitViewController<\/strong>\u3068\u3057\u307e\u3059\u3002Fruit\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b<strong>FruitViewController.xib<\/strong>\u3092\u4fdd\u5b58\u3057\u307e\u3059\u304b\u3068\u3044\u3046\u3088\u3046\u306a\u78ba\u8a8d\u753b\u9762\u304c\u51fa\u308b\u306e\u3067\u3001\u4e0b\u306e\u9818\u57df\u306eFruit\u306b\u30c1\u30a7\u30c3\u30af\u3057\u3066\u304b\u3089Add\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u3053\u307e\u3067\u5b8c\u4e86\u3059\u308c\u3070\u3001Interface Builder\u3092\u9589\u3058\u3066\u3001XCode\u306b\u623b\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>view\u3092\u64cd\u4f5c\u3059\u308b\u306b\u306fViewController\u3092\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>XCode\u4e0a\u304b\u3089 \u30d5\u30a1\u30a4\u30eb \uff1e \u65b0\u898f\u30d5\u30a1\u30a4\u30eb \u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n<p><strong>UIViewController subclass <\/strong>\u3092\u9078\u629e\u3057\u3001\u6b21\u3078\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><strong>FruitViewController.m<\/strong>\u3068\u3044\u3046\u540d\u524d\u306b\u3057\u3066\u4fdd\u5b58\u3057\u307e\u3059\u3002\u540c\u6642\u306b\u201d<strong>FruitViewController.h<\/strong>\u201d\u3082\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u3001\u5148\u307b\u3069\u8ffd\u52a0\u3057\u305f<strong>UITextView<\/strong><span style=\"outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 12px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-weight: bold; background-position: initial initial; background-repeat: initial initial; padding: 0px; margin: 0px; border: 0px initial initial;\"> \u306e<\/span><strong>Interface Builder Outlet <\/strong>\u3092\u5ba3\u8a00\u3057\u307e\u3059\u3002<\/p>\n<p><strong>FruitViewController.h <\/strong>\u3092\u958b\u304d\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<blockquote>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12e1b;\"><span style=\"color: #78492a;\">#import <\/span>&lt;UIKit\/UIKit.h&gt;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">@interface<\/span> FruitViewController : UIViewController {<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span><span style=\"color: #bb2da2;\">IBOutlet<\/span> UITextView *fruitDescription;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">}<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">@property<\/span>(<span style=\"color: #bb2da2;\">nonatomic<\/span>,<span style=\"color: #bb2da2;\">retain<\/span>) <span style=\"color: #bb2da2;\">IBOutlet<\/span> UITextView *fruitDescription;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #bb2da2;\">@end<\/p>\n<\/blockquote>\n<p><strong>FruitViewController.m <\/strong>\u3092\u958b\u304d\u3001\uff20implementation\u884c\u306e\u4e0b\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002\u3053\u308c\u3067 fruitDescription \u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u30b2\u30c3\u30bf\u30fc\uff06\u30bb\u30c3\u30bf\u30fc\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<blockquote>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">@synthesize<\/span> fruitDescription;<\/p>\n<\/blockquote>\n<p><strong>FruitViewController.xib <\/strong>\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3057\u3001Interface Builder\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002\u5148\u307b\u3069\u4f5c\u6210\u3057\u305fFruitViewController\u30af\u30e9\u30b9\u3068view\u3092\u95a2\u9023\u3065\u3051\u307e\u3059\u3002<\/p>\n<p><strong>File\u2019s Owner<\/strong>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>Identity Inspector \u304b\u3089\u4e0b\u56f3\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-7.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-672\" title=\"05-7\" src=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-7-134x300.jpg\" alt=\"05-7\" width=\"134\" height=\"300\" \/><\/a>Interface Builder \u306e\u6700\u5f8c\u306e\u4f5c\u696d\u306f\u3001<strong>UITextView<\/strong>\u3092\u63a5\u7d9a\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<p><strong>File\u2019s Owner<\/strong>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3001\u4e0b\u56f3\u306e\u3088\u3046\u306bview\u30a6\u30a4\u30f3\u30c9\u30a6\u4e0a\u306e<strong>UITextView\u3068<strong>fruitDescription<\/strong><\/strong>\u3092\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-8.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-673\" title=\"05-8\" src=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-8-204x300.jpg\" alt=\"05-8\" width=\"204\" height=\"300\" \/><\/a>\u540c\u69d8\u306b\u3057\u3066view \u3092FruitViewController.xib\u3068\u30bf\u30a4\u30c8\u30eb\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u30a6\u30a4\u30f3\u30c9\u30a6\u5185\u306eview\u3092\u63a5\u7d9a\u3057\u307e\u3059\u3002(\u4e0b\u56f3\u53c2\u7167)<\/p>\n<p><a href=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-9.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-674\" title=\"05-9\" src=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-9-249x300.jpg\" alt=\"05-9\" width=\"249\" height=\"300\" \/><\/a><strong>File\u2019s Owner<\/strong>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e<strong>Tools -&gt; Connection Inspector <\/strong>\u304c\u4e0b\u56f3\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308c\u3070\u6210\u529f\u3067\u3059\u3002<\/p>\n<p><a href=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/0510.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-675\" title=\"0510\" src=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/0510-134x300.jpg\" alt=\"0510\" width=\"134\" height=\"300\" \/><\/a>Interface Builder\u3092\u9589\u3058\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306b\u3084\u308b\u3079\u304d\u3053\u3068\u306f\u3001\u65b0\u3057\u3044view(\u30d5\u30eb\u30fc\u30c4\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u6642\u306b\u9077\u79fb\u3055\u308c\u308b\u753b\u9762)\u306b\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p><strong>RootViewController.h <\/strong>\u3092\u958b\u304d\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n<blockquote>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12e1b;\"><span style=\"color: #78492a;\">#import <\/span>&lt;UIKit\/UIKit.h&gt;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12e1b;\"><span style=\"color: #78492a;\">#import <\/span>&#8220;FruitViewController.h&#8221;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">@interface<\/span> RootViewController : UITableViewController {<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #4e8187;\"><span style=\"color: #000000;\"><span style=\"white-space: pre;\"> <\/span><\/span>FruitViewController<span style=\"color: #000000;\"> *fruitView;<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">}<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">@property<\/span>(<span style=\"color: #bb2da2;\">nonatomic<\/span>,<span style=\"color: #bb2da2;\">retain<\/span>)FruitViewController *fruitView;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #bb2da2;\">@end<\/p>\n<\/blockquote>\n<p><strong>fruitViewController <\/strong>\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002#import \u6587\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u306b\u3082\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306b\u3088\u308a\u3001<strong>FruitViewController <\/strong>\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u4f5c\u6210\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306b<strong>RootViewController.m <\/strong>\u3092\u958b\u304d\u3001<strong>numberOfRowsInSection <\/strong>\u3092\u63a2\u3057\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7de8\u96c6\u3057\u307e\u3059\u3002\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001UITableView\u304c\u3044\u304f\u3064\u306e\u884c\u3092\u8868\u793a\u3059\u308b\u304b\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u4eca\u56de\u306e\u30b1\u30fc\u30b9\u3067\u306f\u914d\u5217\u306e\u6570\u3060\u3051\u884c\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<blockquote>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400;\">\/\/ Customize the number of rows in the table view.<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">&#8211; (<span style=\"color: #703daa;\">NSInteger<\/span>)tableView:(<span style=\"color: #703daa;\">UITableView<\/span> *)<span style=\"color: #703daa;\">tableView<\/span> numberOfRowsInSection:(<span style=\"color: #703daa;\">NSInteger<\/span>)section {<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span><span style=\"color: #4e8187;\">FruitAppDelegate<\/span> *appDelegate = (<span style=\"color: #4e8187;\">FruitAppDelegate<\/span> *)[[<span style=\"color: #703daa;\">UIApplication<\/span> <span style=\"color: #3d1e81;\">sharedApplication<\/span>] delegate];<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\"><span style=\"white-space: pre;\"> <\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">return<\/span> appDelegate.<span style=\"color: #4e8187;\">fruits<\/span>.<span style=\"color: #703daa;\">count<\/span>;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">}<\/p>\n<\/blockquote>\n<p>FruitAppDelegate \u304b\u3089\u59cb\u307e\u308b\u884c\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306eappDelegate\u3078\u306e\u30a2\u30af\u30bb\u30b9\u304c\u51fa\u6765\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30ea\u30b2\u30fc\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u3067\u3001fruits\u306ecount\u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u8fd4\u3055\u308c\u307e\u3059\u3002(?)<\/p>\n<p><span style=\"color: #999999;\">The first line allows us to gain access to the appDelegate of our application. This is where we defined the fruit array. Once we have access to the delegate the <\/span><strong><span style=\"color: #999999;\">count<\/span><\/strong><span style=\"color: #999999;\"> property of the fruit gets returned.<\/span><\/p>\n<p>\u6b21\u306b\u3001<strong>cellForRowAtIndexPath <\/strong>\u3092\u63a2\u3057\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<blockquote>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">&#8211; (<span style=\"color: #703daa;\">UITableViewCell<\/span> *)tableView:(<span style=\"color: #703daa;\">UITableView<\/span> *)<span style=\"color: #703daa;\">tableView<\/span> cellForRowAtIndexPath:(<span style=\"color: #703daa;\">NSIndexPath<\/span> *)indexPath {<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">static<\/span> <span style=\"color: #703daa;\">NSString<\/span> *CellIdentifier = <span style=\"color: #d12e1b;\">@&#8221;Cell&#8221;<\/span>;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #3d1e81;\"><span style=\"color: #000000;\"> <\/span><span style=\"color: #703daa;\">UITableViewCell<\/span><span style=\"color: #000000;\"> *cell = [<\/span><span style=\"color: #703daa;\">tableView<\/span><span style=\"color: #000000;\"> <\/span>dequeueReusableCellWithIdentifier<span style=\"color: #000000;\">:CellIdentifier];<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">if<\/span> (cell == <span style=\"color: #bb2da2;\">nil<\/span>) {<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #3d1e81;\"><span style=\"color: #000000;\"> cell = [[[<\/span><span style=\"color: #703daa;\">UITableViewCell<\/span><span style=\"color: #000000;\"> <\/span>alloc<span style=\"color: #000000;\">] <\/span>initWithStyle<span style=\"color: #000000;\">:<\/span>UITableViewCellStyleDefault<span style=\"color: #000000;\"> <\/span>reuseIdentifier<span style=\"color: #000000;\">:CellIdentifier] <\/span>autorelease<span style=\"color: #000000;\">];<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">}<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span><span style=\"color: #4e8187;\">FruitAppDelegate<\/span> *appDelegate = (<span style=\"color: #4e8187;\">FruitAppDelegate<\/span> *)[[<span style=\"color: #703daa;\">UIApplication<\/span> <span style=\"color: #3d1e81;\">sharedApplication<\/span>] delegate];<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span><span style=\"color: #4e8187;\">Fruit<\/span> *f = (<span style=\"color: #4e8187;\">Fruit<\/span> *) [appDelegate.f[ <span style=\"color: #3d1e81;\">objectAtIndex<\/span>:indexPath.<span style=\"color: #703daa;\">row<\/span>];<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\"><span style=\"white-space: pre;\"> <\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">[cell.<span style=\"color: #703daa;\">textLabel<\/span> <span style=\"color: #3d1e81;\">setText<\/span>:f.<span style=\"color: #3d1e81;\">name<\/span>];<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400;\"><span style=\"color: #000000;\"><span style=\"white-space: pre;\"> <\/span><\/span>\/\/ Configure the cell.<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"color: #bb2da2;\">return<\/span> cell;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">}<\/p>\n<\/blockquote>\n<p>&#8220;FruitAppDelegate *appDelegate&#8230;&#8221;\u306e\u884c\u306f\u3001fruit array \u3067\u5ba3\u8a00\u3057\u305fappDelegate\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u30a2\u30af\u30bb\u30b9\u304c\u51fa\u6765\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u6b21\u306e\u884c\u306f\u3001<span style=\"outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 12px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; font-weight: bold; padding: 0px; margin: 0px;\">\u30d5\u30eb\u30fc\u30c4\u914d\u5217\u306e<\/span><strong>objectAtIndex <\/strong>\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6211\u3005\u304c\u4f7f\u7528\u3059\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306findexPath.row\u3092\u4ecb\u3057\u3066\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<span style=\"color: #000000;\">\u3053\u308c\u306fUITableView\u306e\u5404\u884c\u3092\u8868\u3059\u6574\u6570\u5024\u3067\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6700\u5f8c\u306b\u30bb\u30eb\u306esetText\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u3001\u6307\u5b9a\u3055\u308c\u305f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u3042\u308b\u5404\u30d5\u30eb\u30fc\u30c4\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u540d\u79f0\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6700\u5f8c\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u79c1\u305f\u3061\u306fUITableView\u5185\u306e\u3069\u306e\u884c\u304c\u9078\u629e\u3055\u308c\u305f\u304b\u3092\u691c\u51fa\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>didSelectRow <\/strong><\/span>\u3092\u63a2\u3057\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7de8\u96c6\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<blockquote>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">&#8211; (<span style=\"color: #bb2da2;\">void<\/span>)<span style=\"color: #703daa;\">tableView<\/span>\ud83d\ude41<span style=\"color: #703daa;\">UITableView<\/span> *)<span style=\"color: #703daa;\">tableView<\/span> didSelectRowAtIndexPath:(<span style=\"color: #703daa;\">NSIndexPath<\/span> *)indexPath {<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\">\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400;\"><span style=\"color: #000000;\"><span style=\"white-space: pre;\"> <\/span><\/span>\/*<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400;\"><span style=\"white-space: pre;\"> <\/span> &lt;#DetailViewController#&gt; *detailViewController = [[&lt;#DetailViewController#&gt; alloc] initWithNibName:@&#8221;&lt;#Nib name#&gt;&#8221; bundle:nil];<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400;\">\/\/ &#8230;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400;\">\/\/ Pass the selected object to the new view controller.<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400;\"><span style=\"white-space: pre;\"> <\/span> [self.navigationController pushViewController:detailViewController animated:YES];<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400;\"><span style=\"white-space: pre;\"> <\/span> [detailViewController release];<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400;\"><span style=\"white-space: pre;\"> <\/span> *\/<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\"><span style=\"white-space: pre;\"> <\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #4e8187;\"><span style=\"color: #000000;\"><span style=\"white-space: pre;\"> <\/span><\/span>FruitAppDelegate<span style=\"color: #000000;\"> *appDelegate = (<\/span>FruitAppDelegate<span style=\"color: #000000;\"> *) [[<\/span><span style=\"color: #703daa;\">UIApplication<\/span><span style=\"color: #000000;\"> <\/span><span style=\"color: #3d1e81;\">sharedApplication<\/span><span style=\"color: #000000;\">] <\/span><span style=\"color: #3d1e81;\">delegate<\/span><span style=\"color: #000000;\">];<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span><span style=\"color: #4e8187;\">Fruit<\/span> *fruit = (<span style=\"color: #4e8187;\">Fruit<\/span> *)[appDelegate.<span style=\"color: #4e8187;\">fruits<\/span> objectAtIndex:indexPath.<span style=\"color: #703daa;\">row<\/span>];<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\"><span style=\"white-space: pre;\"> <\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span><span style=\"color: #bb2da2;\">if<\/span>(<span style=\"color: #bb2da2;\">self<\/span>.fruitView == <span style=\"color: #bb2da2;\">nil<\/span>){<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\"><span style=\"white-space: pre;\"> <\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #4e8187;\"><span style=\"color: #000000;\"><span style=\"white-space: pre;\"> <\/span><\/span>FruitViewController<span style=\"color: #000000;\"> *viewController = [[<\/span>FruitViewController<span style=\"color: #000000;\"> <\/span><span style=\"color: #3d1e81;\">alloc<\/span><span style=\"color: #000000;\">] <\/span><span style=\"color: #3d1e81;\">initWithNibName<\/span><span style=\"color: #000000;\">:<\/span><span style=\"color: #d12e1b;\">@&#8221;FruitViewController&#8221;<\/span><span style=\"color: #000000;\"> <\/span><span style=\"color: #3d1e81;\">bundle<\/span><span style=\"color: #000000;\">:[<\/span><span style=\"color: #703daa;\">NSBundle<\/span><span style=\"color: #000000;\"> <\/span><span style=\"color: #3d1e81;\">mainBundle<\/span><span style=\"color: #000000;\">]];<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span><span style=\"color: #bb2da2;\">self<\/span>.fruitView = viewController;<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span>[viewController <span style=\"color: #3d1e81;\">release<\/span>];<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\"><span style=\"white-space: pre;\"> <\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span>}<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px;\"><span style=\"white-space: pre;\"> <\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #3d1e81;\"><span style=\"color: #000000;\"><span style=\"white-space: pre;\"> <\/span>[<\/span><span style=\"color: #bb2da2;\">self<\/span><span style=\"color: #000000;\">.<\/span><span style=\"color: #703daa;\">navigationController<\/span><span style=\"color: #000000;\"> <\/span>pushViewController<span style=\"color: #000000;\">:<\/span><span style=\"color: #bb2da2;\">self<\/span><span style=\"color: #000000;\">.fruitView <\/span>animated<span style=\"color: #000000;\">:<\/span><span style=\"color: #bb2da2;\">YES<\/span><span style=\"color: #000000;\">];<\/span><\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span><span style=\"color: #bb2da2;\">self<\/span>.fruitView.<span style=\"color: #703daa;\">title<\/span> = [fruit <span style=\"color: #3d1e81;\">name<\/span>];<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\"><span style=\"white-space: pre;\"> <\/span>[<span style=\"color: #bb2da2;\">self<\/span>.fruitView.<span style=\"color: #4e8187;\">fruitDescription<\/span> <span style=\"color: #3d1e81;\">setText<\/span>:[fruit <span style=\"color: #3d1e81;\">description<\/span>]];<\/p>\n<p style=\"margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo;\">}<\/p>\n<\/blockquote>\n<p>\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u304cUITableView\u4e0a\u306e\u30bb\u30eb\u3092\u30bf\u30c3\u30d7\u3059\u308b\u305f\u3073\u306b\u547c\u3073\u51fa\u3055\u308c\u307e\u3059\u3002<strong>indexPath <\/strong>\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u30af\u30ea\u30c3\u30af\u3057\u305f\u30bb\u30eb\u756a\u53f7\u3092\u8868\u3059<strong>row<\/strong>\u3068\u3044\u3046\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306e\u30e9\u30a4\u30f3\u306f\u30c7\u30ea\u30b2\u30fc\u30c8\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u53ef\u80fd\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u884c\u306f\u3001\u9078\u629e\u3055\u308c\u305f\u30d5\u30eb\u30fc\u30c4\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30b3\u30d4\u30fc\u3092\u4f5c\u6210\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><span style=\"color: #999999;\">The next line indexes into the fruits array and makes a copy of the selected fruit object.<\/span><\/p>\n<p>if\u3067\u59cb\u307e\u308b\u30bb\u30af\u30b7\u30e7\u30f3\u306f\u3001viewController \u304c\u521d\u671f\u5316\u3055\u308c\u3066\u3044\u306a\u3051\u308c\u3070\u3001\u521d\u671f\u5316\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><strong>initWithNibName <\/strong>\u306b\u6e21\u3059\u540d\u524d\u306f\u3001xib\u30d5\u30a1\u30a4\u30eb\u540d\u3068\u4e00\u81f4\u3057\u3066\u3044\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002\u4eca\u56de\u306f<strong>FruitViewController<\/strong>\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u6b21\u306e\u884c\u306f\u3001<\/p>\n<p><span style=\"color: #999999;\">Following this line is the line that pushes the viewController on to the navigationController stack. This causes the view to transition to the new view.<\/span><\/p>\n<p>\u6700\u5f8c\u306e\uff12\u884c\u306f\u3001\u65b0\u3057\u3044view\u306b\u30d5\u30eb\u30fc\u30c4\u306e\u60c5\u5831\u3092\u6e21\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001view\u306e\u30bf\u30a4\u30c8\u30eb\u306b\u30d5\u30eb\u30fc\u30c4\u306e\u540d\u79f0\u3092\u6e21\u3057\u3001\u30d5\u30eb\u30fc\u30c4\u306e\u8a73\u7d30\u60c5\u5831\u3092description\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0a\u3067\u4eca\u56de\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306f\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u753b\u50cf\u306e\u3088\u3046\u306b\u6700\u521d\u306e\u753b\u9762\u3067\u306f\u3001\u30d5\u30eb\u30fc\u30c4\u30ea\u30b9\u30c8\u304c\u8868\u793a\u3055\u308c\u3001\u540d\u79f0\u3092\u30af\u30ea\u30c3\u30af\u3059\u308c\u3070\u3001\u30d5\u30eb\u30fc\u30c4\u306e\u8a73\u7d30\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u3001\u30bf\u30a4\u30c8\u30eb\u304c\u30d5\u30eb\u30fc\u30c4\u540d\u306b\u306a\u3063\u305fview\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-11.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-677\" title=\"05-11\" src=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-11-158x300.jpg\" alt=\"05-11\" width=\"158\" height=\"300\" \/><\/a><\/p>\n<p style=\"text-align: center;\">\u2191\u8d77\u52d5\u76f4\u5f8c\u306e\u753b\u9762<\/p>\n<p><a href=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-12.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-678\" title=\"05-12\" src=\"http:\/\/yamazon.org\/wp-content\/uploads\/2010\/12\/05-12-158x300.jpg\" alt=\"05-12\" width=\"158\" height=\"300\" \/><\/a><\/p>\n<p style=\"text-align: center;\">\u2191\u30e1\u30ed\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u5f8c\u306e\u753b\u9762<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306f\u3001\u914d\u5217\u30c7\u30fc\u30bf\u3092\u4f7f\u3063\u3066\u3001UITableView\u3068\u9023\u643a\u3055\u305b\u308b\u65b9&#8230;<\/p>\n","protected":false},"author":1,"featured_media":664,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-658","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-old-blog"],"_links":{"self":[{"href":"https:\/\/apr20.net\/index.php?rest_route=\/wp\/v2\/posts\/658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/apr20.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/apr20.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/apr20.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/apr20.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=658"}],"version-history":[{"count":0,"href":"https:\/\/apr20.net\/index.php?rest_route=\/wp\/v2\/posts\/658\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/apr20.net\/index.php?rest_route=\/"}],"wp:attachment":[{"href":"https:\/\/apr20.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/apr20.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/apr20.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}