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

  • Home
  • SEARCH
  • 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 7071119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:38:57+00:00 2026-05-28T05:38:57+00:00

I’ll try and keep this simple. .h NSMutableArray *allEventsData; @property (nonatomic, retain) NSMutableArray *allEventsData;

  • 0

I’ll try and keep this simple.

.h

NSMutableArray *allEventsData;
@property (nonatomic, retain) NSMutableArray *allEventsData;

.m


-(void) test {  
        DAL *db = [[DAL alloc] init]

        self.allEventsData = [[NSMutableArray alloc] initWithArray:[db readUniversityEvents]];

        //to test

        for(int i = 0; i < [allEventsData count]; i++) {
           UniversityEvents *obj = (UniversityEvents*)[self.allEventsData objectAtIndex:i];
           NSLog(@"%@", obj.eventId);

        }
}

Now that works just fine, however the second this void method is left, I can never access it again, the count property shows that there are still the same amount of records, however if I try the for loop, it will just break out and I’ll get Program received signal: “EXC_BAD_ACCESS”

I’m being a little vague, but I’m hoping for some suggestions as to why this happens.

Thanks

PS Had to type than manually, so please ignore possible spelling errors.

Edit: Just to clarify, I’m storing an array of objects within a new array, could it be that allEventsData is simply pointing to those objects and not retaining a copy? That would explain the bad access exception

EDIT 2:

FYI due to my suspicions above, I also tried the following, however I get SIGABRT exception, currently looking into a solution

self.allEventsData = [[NSMutableArray alloc] initWithArray:[db readUniversityEvent] copyItems:YES];

Log:

-[UniversityEvents copyWithZone:]: unrecognized selector sent to instance 0xdd17f50
2012-01-16 12:13:17.789 sqliteDemo[1211:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UniversityEvents copyWithZone:]: unrecognized selector sent to instance 0xdd17f50'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x00f905a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x010e4313 objc_exception_throw + 44
    2   CoreFoundation                      0x00f920bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x00f01966 ___forwarding___ + 966
    4   CoreFoundation                      0x00f01522 _CF_forwarding_prep_0 + 50
    5   CoreFoundation                      0x00ef0dca -[NSObject(NSObject) copy] + 42
    6   CoreFoundation                      0x00f8bff2 -[NSArray initWithArray:range:copyItems:] + 290
    7   CoreFoundation                      0x00ef3e33 -[NSArray initWithArray:copyItems:] + 99
    8   sqliteDemo                          0x000030f4 -[sqliteDemoViewController displayData] + 242
    9   sqliteDemo                          0x00002e30 -[sqliteDemoViewController updateData] + 427
    10  UIKit                               0x003e64fd -[UIApplication sendAction:to:from:forEvent:] + 119
    11  UIKit                               0x005f8cc3 -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 156
    12  UIKit                               0x003e64fd -[UIApplication sendAction:to:from:forEvent:] + 119
    13  UIKit                               0x00476799 -[UIControl sendAction:to:forEvent:] + 67

UniversityEvents (this is the object which is being stored within the class)
.h

@interface UniversityEvents : NSObject {

}


@property (assign) NSString * eventID;
@property (retain) NSString * title;
@property (retain) NSString * url;
@property (retain) NSString * category;
@property (retain) NSString * date;
@property (retain) NSString * startTime;
@property (retain) NSString * endTime;
@property (retain) NSString * department;
@property (retain) NSString * location;
@property (retain) NSString * description;
//@property (assign) NSInteger * attending;

-(id) initWithData :(NSString *) _eventID :(NSString *) _title :(NSString *)_url :(NSString *)_category :(NSString *)_date
                   :(NSString *)_startTime :(NSString *) _endTime :(NSString *)_department :(NSString *)_location
                   :(NSString *) _description;

@end

.m
@synthesize eventID , title,url,category,date,startTime,endTime,department,location,description;

-(id) initWithData :(NSString *) _eventID :(NSString *) _title :(NSString *)_url :(NSString *)_category :(NSString *)_date
                   :(NSString *)_startTime :(NSString *) _endTime :(NSString *)_department :(NSString *)_location
                   :(NSString *) _description 
{

    self = [super init];
    if(self)
    {
        self.eventID = _eventID;
        self.title = _title;
        self.url = _url;
        self.category = _category;
        self.date = _date;
        self.startTime = _startTime;
        self.endTime = _endTime;
        self.department = _department;
        self.location = _location;
        self.description = _description;
        //self.attending = _attending;
    }

    return self;
}

@end
  • 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-28T05:38:58+00:00Added an answer on May 28, 2026 at 5:38 am

    Change

    @property (assign) NSString * eventID;
    

    to

    @property (retain) NSString * eventID;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.