Monday, 25 March 2013

NSMutableArray type is changed to NSArray type


this structure of objects

code:
mylist(nsobject): items(nsmutablearray)                                  |                                  |__item(nsobject)                                  |         |                                  |         |__ itemkey + itemdescription                                  |                                  |__item(nsoject)                                            |                                            |__ itemkey + itemdescription  
in mylist.h

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 loaded @ beginning");      mylist    =   [[mylist alloc] init];      nslog(@"mylist items class of %@",nsstringfromclass([mylist.items class]));    - (void) check {          nslog(@"mylist items class of %@",nsstringfromclass([wishlist.items class]));  }  
in testclass.m
code:
  // override support editing table view.  - (void)tableview:(uitableview *)tableview commiteditingstyle:(uitableviewcelleditingstyle)editingstyle forrowatindexpath:(nsindexpath *)indexpath{        [mylist.items removeobjectatindex:indexpath.row];      [mylisttableview reloaddata];      nslog(@"before check::::::::mylist items class of %@",nsstringfromclass([appdelegate.wishlist.items class]));      [appdelegate check];        }
after running program,this result debuger

code:
appdelegate loaded @ beginning  class of items __nsarraym  before check::::::::mylist items class of __nsarraym  mylist items class of __nsarrayi
dont know why in check method @ appdelegate.m ,mylist.items class of __nsarrayi.
think have __nsarraym (nsmutablearray).
have had ideas this. please me if experiencing before.
 

@property (nonatomic, copy) ... :confused:

try retain kicks.
 


Forums iPhone, iPad, and iPod Touch iOS Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

No comments:

Post a Comment