3

(Please check link first before answer so you can get what i am trying to say)i have check a code in github where in Xcode i found code something like this in this class its working great even

[[NSArray arrayWithObjects:
                      @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"✨", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", @"", nil]retain];

EDIT:- How its posible to add images directly as in array or how the Emoji Keyboard enable in Xcode Editor?

9to5ios
  • 5,319
  • 2
  • 37
  • 65

4 Answers4

4

This are the Unicode Character. Log that NSArray.

\Ud83d\Ude04 - SMILING FACE WITH OPEN MOUTH AND SMILING EYES

enter image description here

   "\Ud83d\Ude04",
"\Ud83d\Ude0a",
"\Ud83d\Ude03",
"\Ud83d\Ude09",
"\Ud83d\Ude0d",
"\Ud83d\Ude18",
"\Ud83d\Ude1a",
"\Ud83d\Ude33",
"\Ud83d\Ude0c",
"\Ud83d\Ude01",
"\Ud83d\Ude1c",
"\Ud83d\Ude1d",
"\Ud83d\Ude12",
"\Ud83d\Ude0f",
"\Ud83d\Ude13",
"\Ud83d\Ude14",
"\Ud83d\Ude1e",
"\Ud83d\Ude16",
"\Ud83d\Ude25",
"\Ud83d\Ude30",
"\Ud83d\Ude28",
"\Ud83d\Ude23",
"\Ud83d\Ude22",
"\Ud83d\Ude2d",
"\Ud83d\Ude02",
"\Ud83d\Ude32",
"\Ud83d\Ude31",
"\Ud83d\Ude20",
"\Ud83d\Ude21",
"\Ud83d\Ude2a",
"\Ud83d\Ude37",
"\Ud83d\Udc7f",
"\Ud83d\Udc7d",
"\Ud83d\Udc9b",
"\Ud83d\Udc99",
"\Ud83d\Udc9c",
"\Ud83d\Udc97",
"\Ud83d\Udc9a",
"\Ud83d\Udc94",
"\Ud83d\Udc93",
"\Ud83d\Udc98\U2728",
"\Ud83c\Udf1f",
"\Ud83d\Udca4",
"\Ud83c\Udfb5",
"\Ud83d\Udd25",
"\Ud83d\Udca9",
"\Ud83d\Udc4d",
"\Ud83d\Udc4e",
"\Ud83d\Udc4c",
"\Ud83d\Udc9d",
"\Ud83c\Udf8e",
"\Ud83c\Udf92",
"\Ud83c\Udf93",
"\Ud83c\Udf8f",
"\Ud83c\Udf86",
"\Ud83c\Udf83",
"\Ud83c\Udf84",
"\Ud83c\Udf81",
"\Ud83d\Udd14",
"\Ud83d\Udcbf",
"\Ud83d\Udcf7",
"\Ud83d\Udcbb",
"\Ud83d\Udca1"

Take a look at How to enter unicode characters in a UILabel in Interface Builder?

you can click Edit->Special Characters... - there you can find all unicode characters (including the emoji)

Community
  • 1
  • 1
Parag Bafna
  • 22,812
  • 8
  • 71
  • 144
  • Exactly, it is just part of the font! – borrrden Jul 22 '13 at 06:58
  • i know its unicodes, but in the githubcode i dont find unicodes any place they directly use icons as an array my question is how they do it? – 9to5ios Jul 22 '13 at 06:59
  • 1
    Just copy and paste it, like you did. Or type it using a unicode keyboard, etc. Though this kind of question is not about programming. – borrrden Jul 22 '13 at 07:02
  • but is it not sounds wrong ? why a developer use copy and paste every unicode character image in it,if he already know the use of unicodes ? – 9to5ios Jul 22 '13 at 07:04
  • How should I know? I didn't make it! He probably did it so he could easily access them. – borrrden Jul 22 '13 at 07:10
3

If your question is how to enter Emoji characters into the source code directly:

  • In System Preferences -> Keyboard, activate the "Show Keyboard & Character Viewers in menu bar" option.
  • Select "Show Character Viewer" from the menu bar.
  • If necessary, select "Customize list ..." from the top left popup and activate the "Emoji" category.
  • Select the "Emoji" category in the left column.
  • Double click on any character to insert it directly into the source code:

enter image description here

Martin R
  • 529,903
  • 94
  • 1,240
  • 1,382
  • In Xcode there is a menu entry "Special characters..." accessible via `⎇⌘t` – Tassos Jul 22 '13 at 08:19
  • @Tassos: Yes, that is what Nitin Gohel said in his answer. I had forgotten about that and his answer is the simpler solution. And the menu entry is available not only in Xcode but also in many other text editors. – Martin R Jul 22 '13 at 08:31
  • @MartinR Oops, you're right. I should check answers more closely. – Tassos Jul 22 '13 at 08:46
3

No need to unicode you can simply drag and drop smiley like this:-

see this firt you need to open special Character like bellow image:-

enter image description here

Then the window open like:-

enter image description here

Now you just Drage the smily you want to display in array as your question:

 [[NSArray arrayWithObjects:@"",@"✅"nil]retain];
Nitin Gohel
  • 49,482
  • 17
  • 105
  • 144
  • 1
    my given answer something different. you can Thru out xocde no need to open system preference as my first screenshot you can directly open special Character from current project xocde.. :) @iphonemaclover – Nitin Gohel Jul 22 '13 at 07:40
  • 1
    @NitinGohel: You are right, "Edit -> Special Characters..." is a simpler solution! It is available not only in Xcode but in many other text editors. – Martin R Jul 22 '13 at 08:29
1
NSArray *arr = [[NSArray alloc] initWithObjects:[UIImage imageNamed:@"1.png"],[UIImage imageNamed:@"2.png"],[UIImage imageNamed:@"3.png"], nil];
Manish Agrawal
  • 10,958
  • 6
  • 44
  • 76
  • 3
    no i mean in xcode editor they directly use above code? My question is how they do it? means insert emoji icons in array? – 9to5ios Jul 22 '13 at 06:50