小编use*_*812的帖子

如何制作AND或OR表达式?

我写了这个:

if( a == -11 && b == -1 ){
{

if( a == -1) AND ( b == -1)...
Run Code Online (Sandbox Code Playgroud)

但是没有工作,我也有同样的问题OR.如何编写包含OR或的表达式AND

objective-c boolean-expression

8
推荐指数
2
解决办法
5万
查看次数

比较objective-C中的2个字符串

我写了以下代码:

   if (depSelectedIndice > -1 && comSelectedIndice> -1)
        {
            NSLog(@"depart elemet : %d ",depSelectedIndice);
            NSLog(@"depart elemet : %d ",comSelectedIndice);
            NSLog(@"ok1");
            NSString *choosedDate =[NSString stringWithFormat:@"%@%@",[deparatureDates objectAtIndex:depSelecif (depSelectedIndice > -1 && comSelectedIndice> -1)
    {
        NSLog(@"depart elemet : %d ",depSelectedIndice);
        NSLog(@"depart elemet : %d ",comSelectedIndice);
        NSLog(@"ok1");
        NSString *choosedDate =[NSString stringWithFormat:@"%@%@",[deparatureDates objectAtIndex:depSelectedIndice], [goingBackDates objectAtIndex:comSelectedIndice]];
        NSLog(@"0000000000001");

        NSLog(@" number of element : %d", [allCombinations count]);
//        for (int j=0; j<[allCombinations count]; j++)
//        {
//            NSLog(@"111111111111111111");
//           // NSString *date = [[allCombinations objectAtIndex:j] objectForKey:@"keydate"];
//            NSLog(@"22222222222222222222"); …
Run Code Online (Sandbox Code Playgroud)

string iphone comparison objective-c nsstring

1
推荐指数
1
解决办法
2万
查看次数