// Form the query.
NSString *query = [NSString stringWithFormat:@"select firstTimeStamp from activityTimeStamp where userId=\"%@\" And buddyId=\"%@\"",[PFUser currentUser].username,buddyId];
// Get the results.
if (self.arrTimeStampInfo != nil) {
self.arrTimeStampInfo = nil;
}
// Getting Data into Array
self.arrTimeStampInfo = [[NSArray alloc] initWithArray:[self.dbManager loadDataFromDB:query]];
// Get the results.
if (self.arrTimeStampInfo != nil) {
self.arrTimeStampInfo = nil;
}
NSLog(@"Array containing records%@", self.arrTimeStampInfo);
and it prints ( (1111132324) )
NSString *string = [_arrTimeStampInfo objectAtIndex: 0];
when i print the string it comes like (1111132324) and i want to remove those brackets want only number in the string? Any clue will be highly appreciated.
// Getting Data into Array
self.arrTimeStampInfo = [[NSArray alloc] initWithArray:[self.dbManager loadDataFromDB:query]];
NSArray* firstItem = [self.arrTimeStampInfo objectAtIndex:0];
NSString* string1 = [firstItem objectAtIndex:0];
NSLog(@"Array containing records%@", string1);
NSInteger a=[string1 intValue];
NSLog(@"time stamp finally we got = %ld",a);
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments