Tag: ios

如何使用Facebook iOS SDK检索Facebook响应

我正在使用iPhone的iOS iOS SDK。 我初始化Facebook实例 facebook = [[Facebook alloc] initWithAppId:kAppId]; 然后我login: [facebook authorize:permissions delegate:self]; login到Facebook之后,我正在执行以下操作以获取用户configuration文件信息: [facebook requestWithGraphPath:@"me" andDelegate:self]; NSMutableData *response = [fbRequest responseText]; unsigned char *firstBuffer = [response mutableBytes]; NSLog(@"Got Facebook Profile: : \"%s\"\n", (char *)firstBuffer); 但是我在控制台上看到以下内容: Got Facebook Profile: "(null)" 我做错了什么,我也相信,Facebook的反应是一个JSONstring,我期待得到一个JSONstring的持有。

如何模仿iOS 7上的键盘animation,将“完成”button添加到数字键盘?

我一直在做这样的事情来模仿旧版iOS的键盘animation。 CGRect keyboardBeginFrame; [[note.userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] getValue:&keyboardBeginFrame]; self.doneKeyboardButton.frame = CGRectMake(0, (keyboardBeginFrame.origin.y + keyboardBeginFrame.size.height) – 53, 106, 53); [[[[UIApplication sharedApplication] windows] lastObject] addSubview:self.doneKeyboardButton]; CGPoint newCenter = CGPointMake(self.doneKeyboardButton.superview.frame.origin.x + self.doneKeyboardButton.frame.size.width/2, self.doneKeyboardButton.superview.frame.size.height – self.doneKeyboardButton.frame.size.height/2); [UIView animateWithDuration:[[note.userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue]-.02 delay:.0 options:[[note.userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue] animations:^{ self.contentView.frame = CGRectOffset(self.contentView.frame, 0, -TextFieldViewMovement); self.doneKeyboardButton.center = newCenter; } completion:nil]; 但是,这已经停止在iOS7上工作。 看起来像返回的值不再是完全正确的,完成button不再完全模仿键盘显示animation。

如何在UITableView中实现UISearchController – Swift

我是Swift的新手,我试图添加searchfunction,我的UITableView是在UIViewController类。 我GOOGLE了很多,发现UISearchDisplayController已被弃用,并由UISearchController取代。 当我试图寻找教程,我没有find任何具体的UITableView 。 其中一些是在UITableViewController实现的。 所以这是我的问题: 我们可以在UIViewController类的UITableView中实现UISearchController吗? (我想我们可以) 如果可以的话,请转换Objective-C中编写的这些代码行。 或者如果有一些非常好的教程,请让我知道。 @property (strong, nonatomic) UISearchController *searchController; UITableViewController *searchResultsController = [[UITableViewController alloc] init]; // Init UISearchController with the search results controller self.searchController = [[UISearchController alloc] initWithSearchResultsController:searchResultsController]; // Link the search controller self.searchController.searchResultsUpdater = self; 资源 编辑:我想分配search结果更新在 class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate, UISearchResultsUpdating { override func viewDidLoad() { […]

UIFont – 如何获得系统精简的字体

UIFont有获取常规字体( systemFontOfSize )或粗体字体( boldSystemFontOfSize )的方法,但是如何通过storyboard获得“精简系统字体”? 将“system-thin”传递给UIFont不起作用,这个构造函数只适用于非系统字体。

为UIAlertAction编写处理程序

我向用户展示一个UIAlertView ,我不知道如何编写处理程序。 这是我的尝试: let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: UIAlertControllerStyle.Alert) alert.addAction(UIAlertAction(title: "Okay", style: UIAlertActionStyle.Default, handler: {self in println("Foo")}) 我在Xcode中遇到了一堆问题。 文档中提到了convenience init(title title: String!, style style: UIAlertActionStyle, handler handler: ((UIAlertAction!) -> Void)!) 现在,整个街区/封闭物都比我头高一点。 任何build议都非常感谢。

Xcode 8显示configuration文件不包含签名证书的错误

Xcode 8显示configuration文件不包含签名证书的错误。 这个问题与Xcode-8只与Xcode 7,相同的configuration文件显示相关的识别证书。

在10.8上安装ffmpeg ios库armv7,armv7s,i386和mac

我如何安装最新的ffmpeg ios库armv7,armv7s,i386和通用10.8 Mac?

如何使用UIBezierPath裁剪图像?

我想从UIBezierpath闭path中获取图像(请参阅图像)。 我使用drawRect方法在UIView上绘制图像,并绘制线条使用drawRect方法。 我怎样才能得到特定的闭path图像? 请帮帮我。 提前致谢。 这个代码用于绘制贝塞尔path。 UIBezierPath *aPath = [UIBezierPath bezierPath]; for (NSString *pointString in pointArray) { if ([pointArray indexOfObject:pointString] == 0) [aPath moveToPoint:CGPointFromString(pointString)]; else [aPath addLineToPoint:CGPointFromString(pointString)]; } [aPath closePath];

Google Maps iOS SDK,获取2个位置之间的路线

在使用Google Maps SDK的同时,我试图在iOS上的两个位置之间取得驾驶方向。 我知道我们可以用两种方法做到这一点: 1.)使用URL Scheme,为此,需要将Google Maps App安装在您的设备上。 2.)使用Directions API,通过请求响应,然后parsingJSON。 显示标记以显示方向。 现在,我的问题是有什么其他方式可以在iOS上做到这一点? 我需要显示从我的当前位置到具有纬度/经度的特定位置的方向。 我的意思是真的不可能简单地通过2位置作为参数和谷歌地图SDK,会给我的方向? 谢谢,

如何在UICollectionViewCell上显示标准复选标记?

我正在devise一个带有UICollectionView的iOS应用程序,我希望用户能够在这个视图中select多个项目。 看来苹果公司在这种情况下使用的标记标记风格。 例如,在下面的图片中,您可以在分享工作表中select多张照片时看到它。 根据文档 ,您负责更新单元的UI以反映其select状态。 我知道在UITableViewCell上,你可以设置accessoryType属性来添加一个复选标记,但我似乎无法findUICollectionViewCell的任何等价物。 有没有一种方法苹果公司提供使用这个复选标记在我的应用程序,除了试图从图像中抓取这个图标?