views:

205

answers:

1
  NSDecimalNumber *lat = [[NSDecimalNumber alloc]initWithDouble:sqlite3_column_double(selectStatement, 1)];
    [latt addObject:lat];
                    [lat release];

  CLLocationCoordinate2D annot;
            annot.latitude = [[latt objectAtIndex:k]doubleValue];

The above 2 codes shows the creation and retrieving of double values from an array. I've stored some values of type double in the database. I retrieve them and store them in an array. I'm not getting any problem there.

But when i try to get them out of the array, as in the second one, i'm getting a warning, paasing argument 1 if 'objectAtIndex' makes pointer from integer without a cast. What might be the problem?

Also when i try to assign the unsigned integer stored in the array as NSNumber to an unsigned integer variable, 'm getting a warning assignmentmakes pointer from integer without a cast. What are these warnings pointing to?

   [back addObject:[NSNumber numberWithUnsignedInt:12]];
    k = [[back objectAtIndex:0]unsignedIntegerValue];
+4  A: 

Define k as an NSUInteger:

NSUInteger k;
gerry3
yeah... k is an NSUInteger
Nithin
You have it declared as an NSUInteger _pointer_. It should just be an NSUInteger.
gerry3
oh!, silly mistake, thanks ya...
Nithin