Select to view content in your preferred language

Map cache with data, the IsEmpty property is always true.

754
2
Jump to solution
09-12-2012 12:05 AM
StephenThornton
Deactivated User
Hi all,

I'm working through the ArcGIS Mobile sample located here:

http://help.arcgis.com/en/arcgismobile/10.0/apis/arcgismobile/help/index.html#/Building_your_first_A...

There is some code:

if(mobileCache1.IsEmpty)
     .....code that recreates cache from a mobile service
else
     .....mobileCache1.Open();

I know my cache has data because if I comment out the 'IsEmpty' code and just call mobileCache1.Open() then the data is displayed on the map. However the IsEmpty property seems to always return true.

Has anyone else come across this issue?

Thanks in advance.

Steve
0 Kudos
1 Solution

Accepted Solutions
IndraBisen
Occasional Contributor
Dear Steve,


If you call  mobilecache1.isEmpty() function after opening the mobilecache then it will return false. MobileCache.Open method works with empty data also. The code should be like this -

if (mobilecache1.IsValid)
{
mobilecache1.open();

if(mobilecache1.IsEmpty())

{
// code to synchronize (download) mobile cache data

}


//

}


regards
Indra Bisen

View solution in original post

0 Kudos
2 Replies
IndraBisen
Occasional Contributor
Dear Steve,


If you call  mobilecache1.isEmpty() function after opening the mobilecache then it will return false. MobileCache.Open method works with empty data also. The code should be like this -

if (mobilecache1.IsValid)
{
mobilecache1.open();

if(mobilecache1.IsEmpty())

{
// code to synchronize (download) mobile cache data

}


//

}


regards
Indra Bisen
0 Kudos
StephenThornton
Deactivated User
Ah right.

Thank you Indra!
0 Kudos