Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7658617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:13:30+00:00 2026-05-31T13:13:30+00:00

NSMutableArray *tempArr = [[NSMutableArray alloc] init]; if (self.subCategory) { for (int i = 0;

  • 0
 NSMutableArray *tempArr = [[NSMutableArray alloc] init];
 if (self.subCategory) {
    for (int i = 0; i < [self.subCategory count]; i++) 
    {
        NSLog(@"subcat %@, detailItem %@",[[self.subCategory objectAtIndex:i]             valueForKey:@"id_cat"],self.detailItem);
        NSString *sub = [NSString stringWithFormat:@"%@",[[self.subCategory objectAtIndex:i] valueForKey:@"id_cat"]];
        NSLog(@"What the result is %@",([sub isEqualToString:self.detailItem] ? @"Yes" : @"No")); 
        if([sub isEqualToString:self.detailItem])
        {
            NSLog(@"obj of subcat %@",[self.subCategory objectAtIndex:i]);
            [tempArr addObject:[self.subCategory objectAtIndex:i]]; 
        }
    }
    NSLog(@"tempArr %@",tempArr);

Why this code every time gives this output

2012-03-20 15:50:26.156 CameraFunWithFrames[1692:fb03] subcat 1, detailItem 1
2012-03-20 15:50:26.157 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.158 CameraFunWithFrames[1692:fb03] subcat 1, detailItem 1
2012-03-20 15:50:26.158 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.159 CameraFunWithFrames[1692:fb03] subcat 1, detailItem 1
2012-03-20 15:50:26.160 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.160 CameraFunWithFrames[1692:fb03] subcat 2, detailItem 1
2012-03-20 15:50:26.161 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.162 CameraFunWithFrames[1692:fb03] subcat 2, detailItem 1
2012-03-20 15:50:26.163 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.163 CameraFunWithFrames[1692:fb03] subcat 3, detailItem 1
2012-03-20 15:50:26.164 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.165 CameraFunWithFrames[1692:fb03] subcat 4, detailItem 1
2012-03-20 15:50:26.165 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.174 CameraFunWithFrames[1692:fb03] subcat 5, detailItem 1
2012-03-20 15:50:26.176 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.176 CameraFunWithFrames[1692:fb03] subcat 6, detailItem 1
2012-03-20 15:50:26.177 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.177 CameraFunWithFrames[1692:fb03] subcat 3, detailItem 1
2012-03-20 15:50:26.178 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.178 CameraFunWithFrames[1692:fb03] subcat 7, detailItem 1
2012-03-20 15:50:26.179 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.180 CameraFunWithFrames[1692:fb03] subcat 8, detailItem 1
2012-03-20 15:50:26.180 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.181 CameraFunWithFrames[1692:fb03] subcat 9, detailItem 1
2012-03-20 15:50:26.181 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.182 CameraFunWithFrames[1692:fb03] subcat 4, detailItem 1
2012-03-20 15:50:26.182 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.186 CameraFunWithFrames[1692:fb03] subcat 5, detailItem 1
2012-03-20 15:50:26.186 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.187 CameraFunWithFrames[1692:fb03] subcat 6, detailItem 1
2012-03-20 15:50:26.188 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.188 CameraFunWithFrames[1692:fb03] subcat 7, detailItem 1
2012-03-20 15:50:26.189 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.190 CameraFunWithFrames[1692:fb03] subcat 8, detailItem 1
2012-03-20 15:50:26.190 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.191 CameraFunWithFrames[1692:fb03] subcat 9, detailItem 1
2012-03-20 15:50:26.191 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.192 CameraFunWithFrames[1692:fb03] subcat 1, detailItem 1
2012-03-20 15:50:26.193 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.193 CameraFunWithFrames[1692:fb03] subcat 2, detailItem 1
2012-03-20 15:50:26.194 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.195 CameraFunWithFrames[1692:fb03] subcat 1, detailItem 1
2012-03-20 15:50:26.195 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.196 CameraFunWithFrames[1692:fb03] subcat 1, detailItem 1
2012-03-20 15:50:26.196 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.197 CameraFunWithFrames[1692:fb03] subcat 1, detailItem 1
2012-03-20 15:50:26.198 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.198 CameraFunWithFrames[1692:fb03] subcat 1, detailItem 1
2012-03-20 15:50:26.199 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.200 CameraFunWithFrames[1692:fb03] subcat 1, detailItem 1
2012-03-20 15:50:26.200 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.201 CameraFunWithFrames[1692:fb03] subcat 1, detailItem 1
2012-03-20 15:50:26.201 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.202 CameraFunWithFrames[1692:fb03] subcat 1, detailItem 1
2012-03-20 15:50:26.202 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.203 CameraFunWithFrames[1692:fb03] subcat 1, detailItem 1
2012-03-20 15:50:26.204 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.204 CameraFunWithFrames[1692:fb03] subcat 1, detailItem 1
2012-03-20 15:50:26.205 CameraFunWithFrames[1692:fb03] What the result is No
2012-03-20 15:50:26.205 CameraFunWithFrames[1692:fb03] tempArr (
)

even if that shows subcat 1 and detailItem 1 both are nsstring but gives no if i compare them using isEqualToString function why??

what should i do to resolve this ?
i use xcode 4.3 and my application used storyboard instead of xib
it works fine with xibs as i have used it before

Please help me
Thanks in advance.

EDIT:: Got the solution thanks to you all who reply to this question thanks to you all

I put all data in plist file to type string as i need them as string before they are number specially the id_cat key.
On conversion it give some unexpected results.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:13:31+00:00Added an answer on May 31, 2026 at 1:13 pm

    There’s no technical reason why you’d get a different result using XIBs versus Storyboard, so I suspect a typo or some other small, unintentional change. Are there spaces at the end of self.detailItem? (When I use NSLog or thr debugger I always print a string such as @"**%@**" so I can see.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

-(NSMutableArray *)processResult:(NSArray*)matchArray removeString:(NSString *)removeStr{ NSString *newLink; NSMutableArray *result = [[NSMutableArray alloc] initWithCapacity:[matchArray count]]; //doing
I have one function like this -(NSMutableArray *)getData { NSMutableArray *tempArr=[NSMutableArray alloc]init]; // perform
NSMutableArray *tempMutableArray = [[NSMutableArray alloc] init]; if (street != NULL) { [tempMutableArray addObject:(NSString *)street];
NSMutableArray *noDup = [[NSMutableArray alloc]init]; NSMutableArray *dup = [[NSMutableArray alloc]init]; for (NSString *first in
NSMutableArray *insideArray = [[NSMutableArray alloc] init]; NSMutableArray *outsideArray = [[NSMutableArray alloc] init]; [insideArray addObject:@Hello
NSMutableArray *output = [[NSMutableArray alloc]init]; or NSArray *output = [[NSMutableArray alloc]init]; I can set
arr = [[NSMutableArray alloc]init]; [arr addObject:[NSNumber numberWithInt:4]]; [arr addObject:[NSNumber numberWithInt:45]]; [arr addObject:[NSNumber numberWithInt:23]]; [arr
NSMutableArray*array = [[NSMutableArray alloc]init]; NSArray*Somearray = [NSArray arrayWithObjects:1st Object,2ndObject,3rd Object,4th object,5th Object,nil]; In the
EmployeesArray = [[NSMutableArray alloc] initWithCapacity:100]; Employees *Emp1 = [[Employees alloc] init]; Emp1.Number = 1;
NSMutableArray *nameArray = [[NSMutableArray alloc] init]; [nameArray addObject:@abc]; [nameArray addObject:@cdf]; [nameArray addObject:@jkl]; //Use a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.