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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:35:20+00:00 2026-06-15T23:35:20+00:00

i have a Person classs @interface Person : NSObject @property (nonatomic, strong) NSString *

  • 0

i have a Person classs

@interface Person : NSObject

@property (nonatomic, strong) NSString * name;
@property (nonatomic, strong) NSString * area;
@property (nonatomic, strong) int pin;
- (id) initWithName:(NSString *)anName andAreaName:(NSString *)anArea andPin:(int)aPin;

First i am reading a sqlite DB and fetching the a list of data i.e. name,area & pin.
Then i create an object of Person class & adding these fetched item in to it .Finally i add this object into an array.Now based on this array i am creating an table view & showing all these 3 data in different rows of a table view.

But now i have a Add New Name option is there on selection of which a pop up with text field will appear and on selection of submit option , a new row will be created with only name field in my table view.

So for this i have to update my old array or update initWithName: ?

Please guide me how to do this?

  • 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-15T23:35:20+00:00Added an answer on June 15, 2026 at 11:35 pm

    You can do this as follows,

    Step 1:-

    Create a Person object as follows,

    Person *person = [[Person alloc] initWithName:@"Name" andAreaName:@"" andPin:0];
    

    You can later add area and pin as,

    person.area = @"Area";
    person.pin = 10;
    
    //or just do, 
    Person *person = [[Person alloc] initWithName:@"Name" andAreaName:@"Area" andPin:10];
    //if you have Area and Pin already available, you can use the above line itself.
    

    Step 2:-

    Add this to data source array of table,

    [self.array addObject:person];
    

    Step 3:-

    [self.tableView reloadData];//or do an insert row call on this tableview
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have my class @interface Person : NSObject { NSString *name; } I
I have a Person class which has an instance variable: Name and Person. @interface
Say I have two domain objects and a mapper interface. class Person { int
I have class Person class person{ int ID ; sting FirstName ; string Last
Example-I have a person class Public Class Person Private _fname As String Public Property
I have a class Person and a class Name. Name contains two Strings firstName
I have a ViewModel class that implements the IDataErrorInfo Interface . In each property's
I have a class called Person with a property that specifies if there is
I have an entity like this: public class Person { public string Name {
Below I have a Person interface, an implementing class and a driver class which

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.