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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:22:20+00:00 2026-05-21T05:22:20+00:00

I have a singleton object is a card I already defined I want to

  • 0

I have a singleton object is a card I already defined I want to change the value of this card currant…

@interface CartesManager : NSObject {
    NSMutableArray *carteMan ; 
    NSInteger indexCarteCourante ;
    BOOL isEditable ;
}

@property(nonatomic,retain) NSMutableArray *carteMan ; 
@property(nonatomic)        NSInteger indexCarteCourante ; 
@property(nonatomic)        BOOL isEditable ; 

+(CartesManager*)sharedInstance;

Object:

@interface Carte : NSObject {
    NSString *titre ; 
    NSString *commentaire ; 
    UIImage *image1 ; 
    UIImage *image2 ; 
    NSString *information ; 
} 
@property (nonatomic,retain )NSString *titre ; 
@property (nonatomic,retain) NSString *commentaire ; 
@property (nonatomic,retain) UIImage *image1 ; 
@property (nonatomic,retain) UIImage *image2 ; 
@property (nonatomic,retain) NSString *information ; 





-(void) edit:(id)sender 
{
    Carte *uneCarte = [[Carte alloc]init]; 
    uneCarte.titre = textField.text ; 
    uneCarte.commentaire = textView.text ; 
    uneCarte.image1 = imageView1.image ; 
    uneCarte.image2 = imageView2.image; 
    [[[[CartesManager sharedInstance] carteMan]objectAtIndex:[[CartesManager sharedInstance]indexCarteCourante]]addObject:uneCarte]; //don't Work to allocate in my array in this carte 
}
  • 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-21T05:22:21+00:00Added an answer on May 21, 2026 at 5:22 am

    You are adding an object instead of modifying an existing object in the array. Try:

    -(void) edit:(id)sender
    { 
      Carte *uneCarte = [[[CartesManager sharedInstance] carteMan]objectAtIndex:[[CartesManager sharedInstance]indexCarteCourante]];
      uneCarte.titre = textField.text;
      uneCarte.commentaire = textView.text;
      uneCarte.image1 = imageView1.image;
      uneCarte.image2 = imageView2.image;
    }
    

    Hope this helps.

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

Sidebar

Related Questions

I have a singleton implemented like this: class Test123(object): _instance = None def __new__(cls,
I have an object in Guice with scope singleton. In method f() I want
I have a singleton object and have a dictionary defined in it. public class
I want to have singleton class that its object is not statically created. having
I have MVVM Project and I want to share one object( singleton ) from
I have a JavaScript singleton object created with closure method: /** * This is
Using StructureMap, is it possible to have a singleton object for each value of
I have a singleton object that use another object (not singleton), to require some
I'll try to explain myself, I have an object Person and a singleton object
I have an object of some class that obeys the singleton pattern. I need

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.