usersfreeiphonecode
Thursday, 5 February 2015
Comparing a string to an array in objective-C
NSArray
*your_array = [
NSArray
arrayWithObjects
:
@"8"
,
@"9"
,
@"1"
,
nil
];
if
([your_array
containsObject
:
@"4"
]) {
NSLog
(
@"yes"
);
}
else
{
NSLog
(
@"No"
);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment