Tag: 目标C

在过渡animation中共享两个viewController之间的图像

自从UIViewControllerAnimatedTransitioning协议在IOS 7中可用以来,我遇到了viewControllers之间非常酷的转换。最近我注意到Intacart的IOS应用程序中特别有趣的一个。 这里是我正在慢慢议论的animation: https : //www.dropbox.com/s/p2hxj45ycq18i3l/Video%20Oct%2015%2C%207%2023%2059%20PM.mov?dl=0 首先,我认为它与本教程中的作者相似,并带有一些额外的淡入和淡出animation: http : //www.raywenderlich.com/cn/113845/ios-animation-tutorial-custom-view-控制器演示跃迁 但是,如果仔细观察,看起来像第一个viewController淡出的两个viewController之间的产品图像转换。 我认为有两个viewControllers的原因是,当你刷新视图,你仍然可以看到它后面的原始视图没有布局的变化。 也许两个viewController实际上有产品形象(不淡出),并以某种方式同时animation,以完美的精度,其中一个淡入淡出。 你认为在那里发生了什么? 如何编写这样一个过渡animation,看起来像是在两个viewControllers之间共享的图像?

MFMailComposeViewController由于iOS6上的全局外观属性而崩溃

当我介绍一个MFMailComposeViewController时,我得到以下崩溃: 2013-11-08 11:04:05.963 <redacted>[7108:1603] *** Assertion failure in NSDictionary *_UIRecordArgumentOfInvocationAtIndex(NSInvocation *, NSUInteger, BOOL)(), /SourceCache/UIKit/UIKit-2380.17/UIAppearance.m:1118 2013-11-08 11:04:06.032 <redacted>[7108:1603] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unknown key, "NSColor" in title text attributes dictionary' 我在AppDelegate的application:didFinishLaunchingWithOptions:追踪了下面的外观设置application:didFinishLaunchingWithOptions: method: [[UINavigationBar appearance] setTitleTextAttributes: @{NSForegroundColorAttributeName : [UIColor whiteColor]}]; 注释该行出了窍门,但遗失了应用程序的其余部分,所以我试着将titleTextAttributes设置为MFMailComposeViewController的空字典: 尝试#1 [[UINavigationBar appearanceWhenContainedIn: NSClassFromString(@"MFMailComposeViewController"), nil] setTitleTextAttributes:@{ }]; 这导致相同的崩溃。 和 [[UINavigationBar appearanceWhenContainedIn: […]

iPhone存储在tmp目录下

我有一个关于iPhone存储这个stackoverflow问题的问题 。 就像我已经试着回答,我们可以caching数据在tmp目录。 但有评论说,当操作系统呜咽时,数据可以被删除。 我不明白评论所说的问题。 我想问是否手动或自动删除tmp目录的操作系统的进程。 换句话说,如果系统自动检测到我们的tmp目录已被删除。 另一个问题是,如果我们可以控制,或者被要求做一些事情(在删除过程之前)可以帮助我们保持tmp目录。 另一个问题是,如果我们不能做任何事情,那么操作系统在什么情况下多长时间才能做到这一点

如何在iPhone SDK 3.0中使用HTTP Live Streaming协议

我已经开发了iPhone应用程序并提交给App Store。 但是我的申请根据以下标准被拒绝了。 感谢您提交您的yyyyyyyy应用程序。 我们已经审查了您的应用程序,并确定它现在不能发布到App Store,因为它没有使用HTTP Live Streaming协议来播放streamvideo。 通过蜂窝networkingstream式传输video时需要HTTP实时stream式传输,以获得最佳的用户体验并利用蜂窝式最佳实践。 该协议自动确定用户可用带宽,并适当调整带宽,即使带宽stream量发生变化。 这样可以让您灵活地拥有尽可能多的数据stream,只要将64 kbps设置为基准数据源即可。 在我的应用程序,我必须从我的服务器stream预先录制的m4v和mp3文件。 我用MPMoviePlayerController来stream和播放这些video/audio。 如何在我的应用程序中实现HTTP直播stream协议? 我也可以得到一些示例代码? 提前致谢!

Instagram挂钩预选媒体问题

这是我的代码。 该文件已正确添加到照片库,但在Instagram应用程序此url – > instagram://library?AssetPath=assets-library%3A%2F%2Fasset%2Fasset.mp4%3Fid=5EDBD113-FF57-476B-AABB-6A59F31170B5&ext=mp4&InstagramCaption=my%caption不会打开最后一个video。 – (void)loadCameraRollAssetToInstagram:(NSURL*)assetsLibraryURL andMessage:(NSString*)message { NSString *escapedString = [self urlencodedString:assetsLibraryURL.absoluteString]; NSString *escapedCaption = [self urlencodedString:message]; NSURL *instagramURL = [NSURL URLWithString:[NSString stringWithFormat:@"instagram://library?AssetPath=%@&InstagramCaption=%@", escapedString, escapedCaption]]; NSLog(@"instagramURL ==> %@",instagramURL); if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) { NSLog(@"Open Instagram!!"); [[UIApplication sharedApplication] openURL:instagramURL]; } else { NSLog(@"Cant open Instagram!!"); [[[UIAlertView alloc] initWithTitle:@"Instagram" message:@"App not installed" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, […]

SKSpriteNode – 创build一个圆angular节点?

有没有办法让一个SKSpriteNode圆angular? 我正在尝试用颜色填充的SKSpriteNode创build一个Tile likesqaure块: SKSpriteNode *tile = [SKSpriteNode spriteNodeWithColor:[UIColor colorWithRed:0.0/255.0 green:128.0/255.0 blue:255.0/255.0 alpha:1.0] size:CGSizeMake(30, 30)]; 我怎样才能使它圆滑? 谢谢!

图像边缘平滑与opencv

我正在尝试使用opencv框架来平滑输出图像的边缘,我正在尝试以下步骤。 从这里采取步骤https://stackoverflow.com/a/17175381/790842 int lowThreshold = 10.0; int ratio = 3; int kernel_size = 3; Mat src_gray,detected_edges,dst,blurred; /// Convert the image to grayscale cvtColor( result, src_gray, CV_BGR2GRAY ); /// Reduce noise with a kernel 3×3 cv::blur( src_gray, detected_edges, cv::Size(5,5) ); /// Canny detector cv::Canny( detected_edges, detected_edges, lowThreshold, lowThreshold*ratio, kernel_size ); //Works fine upto here I am […]

如何调整iOS上的类方法?

方法swizzling很好,例如方法。 现在,我需要调整一个类的方法。 任何想法如何做到这一点? 试过这个,但它不起作用: void SwizzleClassMethod(Class c, SEL orig, SEL new) { Method origMethod = class_getClassMethod(c, orig); Method newMethod = class_getClassMethod(c, new); if(class_addMethod(c, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) class_replaceMethod(c, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod)); else method_exchangeImplementations(origMethod, newMethod); }

有谁知道如何在C#中编写Apple推送通知提供程序?

苹果真的有关于供应商如何连接并传达给他们的服务的文档很糟糕(在写这篇文章的时候 – 2009)。 我对协议感到困惑。 如果有人可以提供这样做的C#示例,将不胜感激。

Facebook获取朋友列表

我知道这里有很多问题,但我找不到合适的答案。 我正在使用Facebook SDK v3.18 我只是想获得用户朋友列表和他们的照片。 我已经尝试了这么多: login: FBLoginView *loginView = [[FBLoginView alloc] initWithReadPermissions: @[@"public_profile", @"email", @"user_friends"]]; // Align the button in the center horizontally loginView.frame = CGRectOffset(loginView.frame, (self.view.center.x – (loginView.frame.size.width / 2)), (self.view.center.y – (loginView.frame.size.height / 2))); [self.view addSubview:loginView]; 获取用户的好友列表及其图片: [FBRequestConnection startWithGraphPath:@"/me/friends?fields=name,picture" parameters:nil HTTPMethod:@"GET" completionHandler:^( FBRequestConnection *connection, id result, NSError *error ) { /* handle […]