我是iOS的新手.我一直在尝试制作一个应用程序,将从相机捕获的图像存储到其中CoreData.我现在知道如何存储像NSStrings NSDate和其他类型的数据,但努力存储图像.我读了很多文章说你必须把它写到磁盘上并写入文件,但我似乎无法理解它.
以下代码是我用于将其他数据存储到核心数据的代码.
- (IBAction)submitReportButton:(id)sender
{
UrbanRangerAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
managedObjectContext = [appDelegate managedObjectContext];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"PotholesDB" inManagedObjectContext:appDelegate.managedObjectContext];
NSManagedObject *newPothole = [[NSManagedObject alloc]initWithEntity:entity insertIntoManagedObjectContext:managedObjectContext];
[newPothole setValue:self.relevantBody.text forKey:@"relevantBody"];
[newPothole setValue:self.subjectReport.text forKey:@"subjectReport"];
[newPothole setValue:self.detailReport.text forKey:@"detailReport"];
// [newPothole setValue:self.imageView forKey:@"photo"];
NSDate *now = [NSDate date];
//NSLog(@"now : %@", now);
NSString *strDate = [[NSString alloc] initWithFormat:@"%@", now];
NSArray *arr = [strDate componentsSeparatedByString:@" "];
NSString *str;
str = [arr objectAtIndex:0];
NSLog(@"now : %@", str);
[newPothole setValue:now …Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我有一个按钮,当按下该按钮时,可以让您观看YouTube视频(电影预告片).在应用程序内,没有启动safari.您可以在下面看到代码段.这个代码在iOS5下运行正常.但是,在iOS 6中,findButtonInView中的UIButton始终为nil.任何想法可能是什么原因?
youtubeWebView.delegate = self;
youtubeWebView.backgroundColor = [UIColor clearColor];
NSString* embedHTML = @" <html><head> <style type=\"text/css\"> body {background-color: transparent; color: white; }</style></head><body style=\"margin:0\"><embed id=\"yt\" src=\"%@?version=3&app=youtube_gdata\" type=\"application/x-shockwave-flash\"width=\"%0.0f\" height=\"%0.0f\"></embed></body></html>";
NSURL *movieTrailer;
if(tmdbMovie) movieTrailer = tmdbMovie.trailer;
else movieTrailer = [NSURL URLWithString:movie.trailerURLString];
NSString *html = [NSString stringWithFormat:embedHTML,
movieTrailer,
youtubeWebView.frame.size.width,
youtubeWebView.frame.size.height];
[youtubeWebView loadHTMLString:html baseURL:nil];
[self addSubview:youtubeWebView];
- (void)webViewDidFinishLoad:(UIWebView *)_webView {
isWatchTrailerBusy = NO;
[manager displayNetworkActivityIndicator:NO];
//stop the activity indicator and enable the button
UIButton *b = [self findButtonInView:_webView];
//TODO this returns null in case of …Run Code Online (Sandbox Code Playgroud) 我遵循此代码从UIImage数组 创建视频.在从一个图像转换到另一个图像时,此处没有动画.我想添加一些像这样的照片过渡效果:
这些动画可以通过UIView.transition()&完成UIView.animate().
但是如何在从UIImage阵列制作视频的同时应用这些过渡动画?我搜索了很多,但没有找到任何东西.
我也试过 HJImagesToVideo,但它只提供Crossfade过渡.
我使用Oracle SQL Developer进行了一个非常大的项目,包含大量的表.
有没有办法可以通过输入其名称来快速打开表格?
例如,在IntelliJIDEA中,ctrl + shift + N快捷方式打开一个带有字段的小型弹出窗口,我可以在其中键入文件的名称.显示名称中包含搜索文本的文件,我可以通过点击快速打开其中一个文件Enter.
我知道桌子在左侧面板上按字母排序,但我有很多桌子,我相信这会节省一些时间.
Oracle SQLDeveloper中是否有类似的东西?
我正在构建一个复杂的应用程序,中间有一个分支.
在应用程序的某个时刻,会出现一个特定的UIViewController,我们称之为mainViewController(缩短mainVC).
所述mainVC呈现另一视图控制器,通过代码,使用下面的代码(I去掉隐私的原因它的一部分):
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"SecondaryStoryboard" bundle:secondaryBundle];
SecondViewController *secondVC = [storyboard instantiateInitialViewController];
[self presentViewController:secondVC animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
因此,secondVC稍后会出现另一个视图控制器,称为thirdVC.这是使用自定义segue完成的,在上面的代码中使用的故事板中设置,代码如下所示:
@implementation VCCustomPushSegue
- (void)perform {
UIView *sourceView = ((UIViewController *)self.sourceViewController).view;
UIView *destinationView = ((UIViewController *)self.destinationViewController).view;
UIWindow *window = [[[UIApplication sharedApplication] delegate] window];
destinationView.center = CGPointMake(sourceView.center.x + sourceView.frame.size.width, destinationView.center.y);
[window insertSubview:destinationView aboveSubview:sourceView];
[UIView animateWithDuration:0.4
animations:^{
destinationView.center = CGPointMake(sourceView.center.x, destinationView.center.y);
sourceView.center = CGPointMake(0 - sourceView.center.x, destinationView.center.y);
}
completion:^(BOOL finished){
[self.sourceViewController presentViewController:self.destinationViewController animated:NO completion:nil]; …Run Code Online (Sandbox Code Playgroud) 我在我的应用程序中使用了SKStoreProductViewController.它显示正确,但有几秒钟的延迟,这会降低用户体验.
我的代码中有什么问题吗?或者我应该通知用户VC正在加载?因为现在可以相信按下按钮后没有发生任何事情(触发以下代码):
-(void)launchApp:(id)sender {
// Recall on main thread if necessary
if (![NSThread isMainThread]) {
[self performSelectorOnMainThread:@selector(launchApp:)
withObject:sender
waitUntilDone:NO];
return;
}
// Initialize Product View Controller
SKStoreProductViewController *storeProductViewController = [[SKStoreProductViewController alloc] init];
// Configure View Controller
[storeProductViewController setDelegate:self];
[storeProductViewController loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier : @"*********"}
completionBlock:^(BOOL result, NSError *error) {
if (error) {
NSLog(@"Error %@ with User Info %@.", error, [error userInfo]);
} else {
// Present Store Product View Controller
[self presentViewController:storeProductViewController animated:YES completion:nil];
}
}];
}
Run Code Online (Sandbox Code Playgroud) 我使用Phonegap和jQuery Mobile设计了一个应用程序.固定页脚正常工作,直到我点击下拉列表或文本字段,这会导致页脚从视图中消失(Android 4.0)或移动到视图的中间(Android 2.2 Galaxy Tab).有什么建议?
Phonegap版本:Cordova 2.1.0
jQuery Mobile版本:1.2.0
这是我的代码:
<div data-role="footer" class="nav-mobilyzer" data-tap-toggle="false" data-position="fixed">
<div data-role="navbar" class="nav-mobilyzer" data-grid="d">
<h1>footer</h1>
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 我正在构建一个 IOS 应用程序,但后来发现我的应用程序应该根据地区/国家采取完全不同的行为。基本上我只想支持3个国家,但是每个国家都有自己的规则和数据。在我的情况下,在单个应用程序中添加所有逻辑、媒体等是没有意义的。
是否可以像在 Google 的 PlayStore 上做的那样,为每个国家/地区都以相同的名称提交不同的应用程序?
我试图搜索这个问题,但找不到任何有用的资源。
我想实现一个UITableView,当我按下我的按钮时ViewController,我可以看到单元格右侧的删除按钮,但不能看到单元格左侧的红色减号圆圈.
有什么想法吗?
我的iPhone应用程序现已进入测试阶段.我正在使用TestFlight将应用程序发送给测试人员.一切都很好,我发布链接,他们下载应用程序,没有任何证书或任何问题(真实的故事,哈哈).
我唯一的问题是我完全不知道如何发送应用程序内更新.我在最新的SDK版本上看到它可用,但我无法弄清楚如何做到这一点!现在,如果我上传新版本,并选择"更新并通知",则会发送一封电子邮件.如何直接通过我的应用向用户发送新版本可用的通知?现在我开始认为这是不可能的(如果是这样,我的坏).但我真的以为我能做到!
一如既往,任何帮助/链接/文档总是受到赞赏!:)
ios ×9
objective-c ×4
iphone ×2
android ×1
app-store ×1
avfoundation ×1
cordova ×1
core-data ×1
in-app ×1
ios6 ×1
ipad ×1
storekit ×1
swift ×1
testflight ×1
uiimage ×1
uitableview ×1
updates ×1
youtube ×1