This is a structure of my Objects
In myList.h
In AppDelegate.m
in testClass.m
After running the program,this is the result from the debuger
I dont know why in check method at AppDelegate.m ,myList.items is a class of __NSArrayI.
I think it have to be __NSArrayM (NSMutableArray).
Have anyone had ideas about this. Please help me if you were experiencing before.
Code:
myList(NSObject): items(NSMutableArray)
|
|__item(NSObject)
| |
| |__ itemKey + itemDescription
|
|__item(NSOject)
|
|__ itemKey + itemDescription
Code:
@interface myList : NSObject <XMLData,NSCoding>
@property (nonatomic, copy) NSMutableArray *items;
In AppDelegate.m
Code:
@implementation AppDelegate
@synthesize window = _window;
@synthesize navigationController = _navigationController;
@synthesize myList, ;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSLog(@"APPDELEGATE IS LOADED AT THE BEGINNING");
myList = [[MyList alloc] init];
NSLog(@"myList items is class of %@",NSStringFromClass([myList.items class]));
- (void) check {
NSLog(@"mylist items is class of %@",NSStringFromClass([wishlist.items class]));
}
Code:
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{
[myList.items removeObjectAtIndex:indexPath.row];
[myListTableView reloadData];
NSLog(@"BEFORE check::::::::myList items is class of %@",NSStringFromClass([appDelegate.wishlist.items class]));
[appDelegate check];
}
Code:
APPDELEGATE IS LOADED AT THE BEGINNING
class of items is __NSArrayM
BEFORE check::::::::myList items is class of __NSArrayM
mylist items is class of __NSArrayI
I dont know why in check method at AppDelegate.m ,myList.items is a class of __NSArrayI.
I think it have to be __NSArrayM (NSMutableArray).
Have anyone had ideas about this. Please help me if you were experiencing before.
Last edited: