{"id":4971,"date":"2014-03-30T17:19:18","date_gmt":"2014-03-30T17:19:18","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/combining-2-strings-in-objective-c-collection-of-common-programming-errors\/"},"modified":"2014-03-30T17:19:18","modified_gmt":"2014-03-30T17:19:18","slug":"combining-2-strings-in-objective-c-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/combining-2-strings-in-objective-c-collection-of-common-programming-errors\/","title":{"rendered":"combining 2 strings in objective-c-Collection of common programming errors"},"content":{"rendered":"<p>I have a problem when I try to combine 2 <code>NSString<\/code><\/p>\n<p>I extract 2 <code>NSSring<\/code> form a JSON and its diagrams are:<\/p>\n<p>thumbList: ( &#8220;picture1.jpg&#8221;, &#8220;picture2.jpg&#8221;, &#8220;picture3.jpg&#8221; &#8230; )<\/p>\n<p>fullnameList: (&#8220;name1&#8221;, &#8220;name2&#8221; , &#8220;name3&#8221; &#8230; )<\/p>\n<p>My intention is unite them into one using the following scheme: (&#8220;name1&#8221;, &#8220;picture1.jpg&#8221;, &#8220;name2&#8221;, &#8220;picture2.jpg&#8221;, &#8220;name3&#8221;, &#8220;picture3.jpg&#8221;&#8230;)<\/p>\n<pre><code>NSArray *array_webdata=[[NSArray array] init];\n\nNSString *searchStatus = [[NSString alloc] initWithData:webData encoding:NSUTF8StringEncoding];    \narray_webdata = [parsedata objectWithString:searchStatus error:nil];\n\n\/\/String with all data of each user\nNSString *usersList = [array_webdata valueForKey:@\"results\"];    \nNSLog(@\"\\n results? = %@ \\n\", usersList);\n\n\/\/String with thumbs\nNSString *thumbList = [usersList valueForKey:@\"thumb\"];\nNSLog(@\"\\n thumbs? = %@ \\n\", thumbList);\n\n\/\/String with usernames\nNSString *fullnameList = [usersList valueForKey:@\"fullname\"];\nNSLog(@\"\\n fullnames? = %@ \\n\", fullnameList);\n\n\nNSMutableIndexSet *indexes = [NSMutableIndexSet indexSetWithIndex:1];\n[indexes addIndex:3];    \n[fullnameList insertObjects:thumbList atIndexes:indexes];\nNSLog(@\"array: %@\", fullnameList);\n<\/code><\/pre>\n<p>But when I try to execute shows the next error message: <strong>[__NSArrayI insertObjects:atIndexes:]: unrecognized selector sent to instance.<\/strong><\/p>\n<p>Can anyone help me?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a problem when I try to combine 2 NSString I extract 2 NSSring form a JSON and its diagrams are: thumbList: ( &#8220;picture1.jpg&#8221;, &#8220;picture2.jpg&#8221;, &#8220;picture3.jpg&#8221; &#8230; ) fullnameList: (&#8220;name1&#8221;, &#8220;name2&#8221; , &#8220;name3&#8221; &#8230; ) My intention is unite them into one using the following scheme: (&#8220;name1&#8221;, &#8220;picture1.jpg&#8221;, &#8220;name2&#8221;, &#8220;picture2.jpg&#8221;, &#8220;name3&#8221;, &#8220;picture3.jpg&#8221;&#8230;) NSArray *array_webdata=[[NSArray [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4971","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4971","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4971"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4971\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}