ios


why my array is null in second time, when I assigned it's first object to dictionay in objective C, ios


Occured a crazy situation. I assinged values to a mutable array in my first method.it worked properly.this is the my code for it.
for (NSDictionary *final in SectorsArray)
{
MoreFligh *more = [MoreFligh new];
more.flightnumber = [final objectForKey:#"FLI_NUM"];
more.airlinecode = [final objectForKey:#"ARL_COD"];
more.departureairport = [final objectForKey:#"DepatureAirport"];
more.departureday = [final objectForKey:#"DepatureDay"];
more.departuredate = [final objectForKey:#"DepatureDate"];
more.departuredime = [final objectForKey:#"DepatureTime"];
more.arrivalairport = [final objectForKey:#"ArrivalAirport"];
more.arrivalday = [final objectForKey:#"ArrivalDay"];
more.arrivaldate = [final objectForKey:#"ArrivalDate"];
more.arrivaltime = [final objectForKey:#"ArrivalTime"];
[testingArray addObject:more];
}
this time testing array is not null and there are two objects with values.no problem.
then in my second method I chencked that array like this.
- (void)chk
{
id bbbbb = testingArray.firstObject;
NSLog(#"%#",bbbbb);
}
then it int the bbbbb (I used a breakpoint here) it had two objects with values.then I check with following code.
- (void)chk
{
NSDictionary *bbbbb = testingArray.firstObject;
NSLog(#"%#",bbbbb);
}
at this time it shows testing array has to objects but with no values.
then I have to create a new model class assign value.otherwise after this step it shows only like no value.I have attached some pictures.if anyone wants I can provide any other details.]2
[]3
when I create a new model, then it works properly until I checked like above.
- (void)chk
{
MoreFligh *bbbbb =(MoreFligh *) testingArray.firstObject;
NSLog(#"%#",bbbbb);
}
I do not understand what the testingArray is, instance variable or temporary variable?
If the instance variable that is, take a look at assignment, make sure no place makes testingArray nil or removeAllObjects.
Or show the .m file completely, let us check.

Related Links

Page view constraints bug
How to rotate and crop iOS CGImage from file
How do I get the value of a UITextfield as characters are being typed in real time?
Any one Know ?? how to get router ip address from mac and iPhone? [closed]
What means iOS Xcode plist warning?
Deleting NSUserdefault Array from a UITableView
how to remove view from superview in apple watch / watchkit in swift
Identifying the trigger of iOS Remote notifications callback
Linker command failed, cannot find library in existing project
Stop all the functions when changing Viewcontroller
iOS & Parse Push Notification - iPhone 5s/c
Flick a UIScrollView programmatically
Negative Error testing in iOS PayPal Sandbox mode
why i have this showAlert error?
Issue in sending email from iOS device?
iPad crash with Foundation

Categories

HOME
ssis
dynamic-programming
common-lisp
jsp
servlets
genetic-algorithm
api.ai
vsix
oracle-adf
windows-server-2012-r2
classloader
tin-can-api
plotly
jena
clion
drag
frequency
axure
openui5
union
jscrollpane
facebook-opengraph
qualtrics
syswow64
jquery-selectors
lookup-tables
gas
formio
gyroscope
google-finance
jpos
co
accelerated-mobile-page
pwm
ibm-datapower
jcrop
liferay-aui
iar
phonegap-desktop-app
google-geocoder
monads
expression-trees
python-behave
dapper-fastcrud
swipe
groove
mobilefirst-bluemix
inria-spoon
haxm
nib
jformattedtextfield
deep-copy
response
otroslogviewer
amazon-elasticsearch
protobuf-3
amazon-vpc
openwebanalytics
name-mangling
html-form
jawr
jquery-ui-accordion
easyhook
jce
tryton
graph-traversal
assembly-references
nuget-package-restore
curly-braces
zenity
gwt-material-design
nsd
bootstrap-slider
sqlfiddle
submission
cover
groupbox
trello.net
spl
structured-programming
crowdflower
fastparse
declaration
adserver
android-design-library
gcovr
applicationstate
mklink
azimuth
junit-runner
transport-stream
prudentia
apache-commons-dbcp
datasift-python
libnids
hla
webcal
northwind
double-precision
headless-browser
mixing
datakey
zmodem
ekeventkit
cellphone
ladon
coolstorage
nstreecontroller
android-searchmanager
apache-config
xoom
regexbuddy
arraycopy
xtratreelist
wmd
net-ssh
msn-messenger
68hc11
sharepoint-feature
plumtree

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App