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 7859833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:03:02+00:00 2026-06-02T22:03:02+00:00

In my application I am having entity class like: #import <Foundation/Foundation.h> @interface classAbc :

  • 0

In my application I am having entity class like:

#import <Foundation/Foundation.h>

@interface classAbc : NSObject
{
    NSString *strTitle;
    int iId;


}

@property(nonatomic, retain)  NSString *strTitle;
@property(nonatomic) int iId;
@end

and in my NSMutableArray I am storing objects of this class like:

classAbc *objAbc=[[classAbc alloc] init];
objAbc.iId=1;
objAbc.strTitle=@"Title 1";

classAbc *objAbc1=[[classAbc alloc] init];
objAbc1.iId=2;
objAbc1.strTitle=@"Title 2";

NSMutableArray *arrTemp=[[NSMutableArray alloc] initWithObjects:objAbc,objAbc1,nil];

[objAbc release];
[objAbc1 release];

and now runtime I want to retrieve Object from this array based on objAbc.iId condition like:

if arrTemp contains object having its iId value as 2 for example.

Can any one suggest way other than for loop iteration? As number objects can increase for loop will take lot of time to find it.

Thanks in advance.

  • 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-06-02T22:03:03+00:00Added an answer on June 2, 2026 at 10:03 pm

    After searching I got answer to this question. Using NSPredicate is the best way for such condition. Using NSPredicate we can apply condition on any member of the class object.

    This is link for MAC OS X however this works on iPhone sdk with some changes.
    NSPredicate

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

Sidebar

Related Questions

A small - little question. I have seen many application having buttons like following.
I'm building a WPF application and this WPF application is having a toolbar-like panel
I am having a problem with Entity Framework in my MVC 3 application. I
I have the following entities in Entity Framework: public class School { public int
I am developing a Silverlight 4 RIA (Entity framework) application and I am having
We are rolling out our first .net 4.0 entity framework application and are having
I am trying to automate a web application having javascript. I am using WWW::Scripter
I am working on JRuby on Rails Application having JRuby-1.6.7 and Rails 3.2.2 I
I have created an tab bar application having 3 tab. When I am launching
I am currently writing an application having a client server architecture. The client is

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.