我正在为基于Web的自定义社交网络应用开发本机移动应用.我们正在构建一个REST API来与Web服务器通信,我们选择了OAuth2作为身份验证方法(grant_type=password流程).
Web应用程序允许用户使用外部服务(即Facebook和Twitter)登录和注册.我们还需要在移动应用上允许相同的内容.问题是:我们怎么做?
Pinterest移动应用程序能够管理这种情况(参见附图).这里使用的流量是多少?

它们的行为类似于经典的OAuth驱动的应用程序(移动应用程序直接使用Facebook API充当OAuth客户端吗?).如果是这样,那么移动应用程序如何通过Pinterest服务器进行身份验证?它是否将Facebook OAuth访问令牌作为凭据传递?
问题的图形表示(请参阅????-labeled arrow):
Website API Mobile app Facebook OAuth
+ + +
| | |
| | /oauth2/token |
| +------------------------------>|
| | |
| | OAuth Access Token |
| |<-----------------------------+|
| | |
| ???? | |
|- - - - - - - - - - - - - -| |
| | |
| | |
| OAuth Access Token | |
|+------------------------->| |
| | …Run Code Online (Sandbox Code Playgroud) 目前有很多关于如何为UITableView 设置自定义固定背景的答案.但有没有任何技巧可以使背景图像与表格单元格一起滚动?
谢谢!
我确信每个可可触摸程序员都必须面对这个问题:我知道Apple希望每个应用程序都将他们的设置放在"设置"应用程序中.但就定制而言,它提供的内容非常有限.此外,最好在应用程序中放置一些设置,因为它们经常更改.
在这种情况下,开发人员必须在自己的应用程序中实现设置管理.重要的是,重新实现所有基本的东西,可以通过简单的plist在Settings应用程序中轻松管理.是否有某种框架/库已经被创建以简化事情,也许可以将类似的plist作为输入?
一般来说,如何在app-settings中实现?你每次都覆盖UITableViewControllers吗?
好的,所以你通常会想要在MKMapView中注释一些对象X. 你这样做:
DDAnnotation *annotation = [[DDAnnotation alloc] initWithCoordinate: poi.geoLocation.coordinate title: @"My Annotation"];
[_mapView addAnnotation: annotation];
Run Code Online (Sandbox Code Playgroud)
然后在里面创建注释视图
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation;
Run Code Online (Sandbox Code Playgroud)
当一些标注被点击时,你在里面处理事件:
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control;
Run Code Online (Sandbox Code Playgroud)
将X传递给最新的点击事件最简洁的解决方案是什么?
我正在尝试构建一个"管理后端"Rails引擎.假设引擎具有以下资产:
ENGINE/app/assets
??? javascripts
? ??? railsyard
? ??? admin.js.coffee
? ??? admin_customizations.js.coffee
...
Run Code Online (Sandbox Code Playgroud)
当admin.js.coffee被要求admin_customizations.js.coffee,就是一个空文件准备由托管Rails应用程序覆盖.
[ENGINE/app/assets/javascripts/my_engine/admin.js.coffee]
#= require admin_customizations
# ...some code...
[ENGINE/app/assets/javascripts/my_engine/admin_customizations.js.coffee]
# Override this empty file to add custom JS behaviour!
Run Code Online (Sandbox Code Playgroud)
一切都运行得很好,直到我试图要求一些来自二级宝石的资产:
[APP/app/assets/javascripts/my_engine/admin_customizations.js.coffee]
#= require modernizr # this line gets ignored
alert "Foobar" # this line works
Run Code Online (Sandbox Code Playgroud)
gem modernizr-rails是托管应用程序的依赖,而不是引擎.请注意,如果我尝试modernizr从资产文件中要求不是某个引擎资产文件的覆盖,那么一切都会再次起作用.
有办法解决这种情况吗?
我已成功将一些UIButtons添加到自定义tableFooterView.问题是按钮事件不会被调用.此外,相对于UIControlStateHighlighted的图像不会出现.有任何想法吗?我已经尝试了所有我能想到的,但我找不到诀窍.我在这里报告了UITableViewController的有趣部分:
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection: (NSInteger)section
{
CGRect footerFrame = CGRectMake(0.0, 0.0, 480, 190);
_footerView = [[UIImageView alloc] initWithFrame: footerFrame];
_footerView.image = [UIImage imageNamed:@"tableviewfooter.png"];
_footerView.contentMode = UIViewContentModeTopLeft;
UIButton *addExam = [self createButtonWithFrame: CGRectMake(10, 30, 460, 58) Target: self Selector: @selector(addNewItem:) Image: @"additem.png" ImagePressed: @"additem_pressed.png"];
[_footerView addSubview:addExam];
return _footerView;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection: (NSInteger) section
{
return 190;
}
- (void) addNewItem:(id)sender
{
// This get's never called
NSLog(@"Pressed");
}
- (UIButton*) createButtonWithFrame: (CGRect) frame Target:(id)target Selector:(SEL)selector Image:(NSString *)image …Run Code Online (Sandbox Code Playgroud) 我UIScrollView有一种习惯UIView,它绝对需要倾听他内心发生的所有触摸事件.
起初,我得到的只是touchesBegan:和touchesCancelled:事件.不touchesMoved:,不touchesEnded:.事实上,所有拖动手势都被上面取消了UIScrollView.这通过以下设置解决:
_scrollView.canCancelContentTouches = NO;
Run Code Online (Sandbox Code Playgroud)
现在,行为会根据UIView上第一次触摸的"时间长度"而变化.如果它很短,则管理相对拖动,因为它是一个滚动UIScrollView.如果它很长,那么我将在touchesMoved:UIView中获取事件.
我想要的是永远收到touchesMoved:我的UIView.我该怎么做?
cocoa-touch ×5
iphone ×4
uitableview ×2
api ×1
ios ×1
ios5 ×1
ipad ×1
mkannotation ×1
mkmapview ×1
oauth-2.0 ×1
objective-c ×1
uiscrollview ×1