objective c - I'm stumped. NSLog verifies the object is what it's supposed to be, but adding the object to array isn't working -
Joodata is a singleton ... the table shows fine, NSLG verifies the correct line, however, jeoData.crewList Returns the zero after adding the object to the NSMutableArray object ...
In Joodata Singleton, the employee list is started equally for the cruiser.
- (zero) tableview: (UITableView *) tableView was done SelectionRowAtIndexPath: (NSIndexPath *) index text {employee * employee = [jeoData.employeeList objectNet: indexPath.row]; [JeoData.crewList addObject: employee]; NSLog (@ "Select Crowview: Added:% @% @", Employee First Name, Employee, Anonymous); NSLog (@ "Total Selected:% lu", (unsigned long) jeoData.crewList.count); } NSLog: 2014-10-17 15: 09: 41.590 Save Endload [98371: 414247] Select Crewview: Added: Jacob Johnson 2014-10-17 15: 09: 41.591 Save Endless [98371: 414247] Total Selected: 0 < / Code>
... even didDeselectRow selects the right object to display, but I can not understand why I can not get the object in the crawllist array.
Any help would be greatly appreciated, because I was stumped.
EDIT: Adding the code as requested
JAADATA.M (Singleton ... where it happens)
@Exployments @joodata @ employee Modify; @ Synthesis lease list; @ Synthesis crew; @ Report synthesis; + (Id) shared manager {static geodata * shared jedoda = zero; Static transmissions_access_one talk; Sending & amp; (& amp; Once Token, ^ {sharedJEodata = [[Allocation] init];)); Return share jedoda; } - (id) init {if (self = [init init]) {employeeList = [[NSMUTABELARROL] init]; Legislative = [[NSMUTABELARROR] INIT]; CrewList = [[NSMUTABELARROL] INIT]; WorkReport = [[NSMUTABELARROL] INST]; } Healthy return; } @end
Joodata has been declared in the @ interface of the header file of the View Controller
@interface SelectCrewViewController: UIViewController & lt; UITableViewDelegate, UITableViewDataSource & gt; {JODATA * JODATA; NSMutableArray * crew; & Lt; --- Only built in troubleshooting, unused now}
seeDidload:
- (zero) viewDidoadload {[Super Feedload]; // Do any additional setup after loading the footage JeoData = [Jodata Sharing Manager]; Self. HoroscopeTab.Samavam Multilevel Selection = Yes; NSLog (@ "Total number of employees:% lu", (unsigned long) jeoData.employeeList.count); NSLog (@ "crew list in crew list:% lu", (unsigned long) jeoData.crewList.count); }
NSLog's return:
2014-10-17 15: 09: 39.473 Save Endload [98371: 414247] Number of employees: 3 2014 -10 -17 15: 09: 39.474 Save Endload [98371: 414247] Staff in the list of crew: 0
So, you can see that jeoData.employeeList has the right things, As jeoData.leaseList, I know that the DisclosureRO is being called due to NSLog, so I know that the purpose of the employee is well and alive, yet it is to miminate the crew list. Will not make a mess of qualified array.
I am doing a lot of things that I am only seeing something, yet I am seeing what this is.
Please help us, OB-WAN Kenobi, you are our only hope.
Resolve, well, I knew I was seeing something ...
In the initial view controller, the first initialization of the Joodata Singleton class, however, does not actually add anything to the crawl lithic variable array, once the problematic view controller was segazed, the crulist array disappears. The track was maintained like an employee
I started the init function at jeoData.crew Saw Diaidilod scene and it allows you to add / remove me from the array.
I just need to figure out whether it will still keep things in the array after going to any other view controller so far.
Comments
Post a Comment