我正在使用AWS Amazon Web Service RDS作为数据库.我已经设置了一个数据库实例,但是如何在该数据库实例中添加表或在数据库中创建任何新表?知道如何添加表吗?
我在其中保存视频文件在文档文件夹中工作正常,但我想获取保存文件的文件大小,我已经搜索但没有得到结果使用NSfileManager,这里是我用来保存视频的代码.我想获取文件大小并在UILabel上显示它.
谢谢
NSURL*videoURL = [info objectForKey:UIImagePickerControllerMediaURL];
NSLog(@"found a video");
videoData = [[NSData dataWithContentsOfURL:videoURL] retain];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSDateFormatter *dateFormat = [[[NSDateFormatter alloc] init] autorelease];
[dateFormat setDateFormat:@"dd-MM-yyyy_HH:mm:SS"];
NSDate *now = [[[NSDate alloc] init] autorelease];
NSDate* theDate = [dateFormat stringFromDate:now];
NSString*myDate=[dateFormat stringFromDate:theDate];
NSString *dataPath = [documentsDirectory stringByAppendingPathComponent:@"Default Album"];
if (![[NSFileManager defaultManager] fileExistsAtPath:dataPath])
[[NSFileManager defaultManager] createDirectoryAtPath:dataPath withIntermediateDirectories:NO attributes:nil error:nil];
NSString*test=@"test";
NSString*testUser=[test stringByReplacingOccurrencesOfString:@" " withString:@""];
videopath= [[[NSString alloc] initWithString:[NSString stringWithFormat:@"%@/%@.mp4",documentsDirectory,testUser]] autorelease];
BOOL success = [videoData writeToFile:videopath …Run Code Online (Sandbox Code Playgroud) 我有app我在使用tableView的问题是,当tableView有一个记录时,它不显示分隔线,但显示有两个记录.
tableView中的第一个单元格是textField.这是我正在使用的代码.
for (UIView *subView in cell.subviews)
{
if (subView.tag == 2 || subView.tag == 22)
{
[subView removeFromSuperview];
}
}
tableView.backgroundView=nil;
tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
tableView.separatorInset = UIEdgeInsetsZero;
if(indexPath.section==0){
tagInputField =[[UITextField alloc]initWithFrame:CGRectMake(0,0,248,31)];
tagInputField.contentVerticalAlignment=UIControlContentVerticalAlignmentCenter;
tagInputField.textAlignment=UITextAlignmentLeft;
tagInputField.backgroundColor=[UIColor whiteColor];
tagInputField.tag = 2;
tagInputField.delegate = self;
tagInputField.clearButtonMode = UITextFieldViewModeWhileEditing;
[tagInputField.layer setCornerRadius:5.0f];
[tagInputField.layer setMasksToBounds:YES];
tagInputField.layer.borderWidth = 0.3;
tagInputField.layer.borderColor = [UIColor darkGrayColor].CGColor;
tagInputField.font=[UIFont fontWithName:@"Myriad-Pro" size:8];
[tagInputField setText:@"Enter tag here "];
tagInputField.textColor =[UIColor grayColor];
tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
[cell addSubview:tagInputField];
return cell;
}
if(indexPath.section==1) {
UIButton *crossButton =[[UIButton …Run Code Online (Sandbox Code Playgroud) 我有表视图,我想在其中选择在查询中添加的最后 10 条记录。我正在使用以下查询返回所有记录,但我想添加最后 10 条记录。
这是查询
NSString* select = [[NSString alloc] initWithFormat:@"select * FROM ContentMaster where ContentAddedByUserID='%@' AND HiveletCode='%@'",appDelegate.userID,appDelegate.organizationCode];
我已经搜索了一些我们可以通过这样的顶级记录获得的地方,我知道我们可以使用两个日期之间的日期来获取任何想法如何在没有日期的情况下获取最后 10 条记录。
我想获取最后 10 个添加的所有数据。