草庐IT

function-centered

全部标签

ios - 针对 Game Center 身份验证的 Xcode 4.6 ARC 警告

这是一个新编译器警告,只有在我将XCode更新到4.6时才会出现。我的代码是直接从Apple的文档中提取的(顺便说一句,这是我的iOS6代码)。GKLocalPlayer*localPlayer=[GKLocalPlayerlocalPlayer];localPlayer.authenticateHandler=^(UIViewController*viewController,NSError*error){[selfsetLastError:error];if(localPlayer.authenticated){警告——在此block中强烈捕获“localPlayer”可能会导致保

ios - performSelector 可能会导致泄漏,因为它的选择器是未知的 IN Singleton Class/FUNCTION Pointer -Passing Function as parameter

@interfaceURLClass:NSObject{idtarget;SELfunObj;}+(URLClass*)sharedInstance;-(void)theBigFunction:(SEL)func:(id)target;@property(nonatomic,retain)SELfunObj;#import"URLClass.h"staticURLClass*instance=NULL;@implementationURLClass{NSMutableData*webData;}-(id)init{if(self=[superinit]){}returnself;}+(

iphone - iOS 中的嵌入字体 : why are they not centered correctly on the y axis?

我在我的iOS应用程序中嵌入了几种字体,但我发现它们在标签和按钮中没有正确居中,它们在y轴上的位置太高,对此有什么解决方案吗?起初我以为这只是我使用的廉价字体文件,但后来我用Adob​​e字体尝试(只是为了看看)它仍然有问题。 最佳答案 我的一个friend指出的(a?)解决方案是使用按钮的contentEdgeInsets属性,我将其设置为:myButton.contentEdgeInsets=UIEdgeInsetsMake(10,0,0,0);将文本向下移动10个像素,现在文本居中。呜呜。

iOS 自动布局 : Align the edge of one button to the center of another button?

所以我有两个UIButtons我想对齐,但不是特别是边缘。我想将一个按钮的(左)边缘与另一个按钮的(水平)中心对齐。所以我希望它看起来像这样:我如何在InterfaceBuilder中和/或以编程方式执行此AutoLayout?我希望这不是一个太多的初学者问题,但iOSAutoLayout有时会让人感到困惑...... 最佳答案 在IB中,在两个按钮之间创建任何水平约束。例如,对齐它们的中心。然后,选择新的约束对象和大小检查器。在那里,您可以更改对齐的属性。选择顶部按钮的前沿。现在底部按钮的CenterX与顶部按钮的前缘对齐。

ios - 设置第三方服务器与 Game Center 交互

我正在考虑为我的iOS游戏添加一项功能,允许玩家创建自己的游戏关卡、与其他玩家分享、评价等。会有一个用户创建的关卡的公共(public)存储库,可排序按创建日期、评级、难度或其他标准。这种功能需要第三方服务器。我在想我会使用Sinatra创建一个RESTfulAPI并在Heroku上运行它。我的问题是:验证此API请求的最佳方式是什么?我不想要求玩家创建用户名和密码。我只想使用GameCenter的ID系统。有什么建议吗?我以前从未做过任何服务器端的事情,所以非常感谢您的帮助!澄清是的,我知道Apple不提供自己的系统。但它确实让开发人员可以访问唯一的GameCenter标识符(dev

ios - 异常 : 'Invalid Region <center:+inf, +0.00000000 span:+1.00000000, +0.50000000>' when trying to display the map

当我尝试显示map时出现此异常:Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'InvalidRegion'我的相关代码是这样的:-(void)viewWillAppear:(BOOL)animated{[mapViewremoveAnnotations:mapView.annotations];//locationManagerupdateaslocationlocationManager=[[CLLocationManageralloc]init];locationManager.de

iphone - iOS 开发 : Strange problem with authenticating Game Center user

我正在构建支持GameCenter(GC)的iPhone游戏。当应用程序启动时,我尝试对本地播放器进行身份验证...if([GKLocalPlayerlocalPlayer].authenticated==NO){[[GKLocalPlayerlocalPlayer]authenticateWithCompletionHandler:^(NSError*error){[selfcallDelegateOnMainThread:@selector(processGameCenterAuth:)withArg:NULLerror:error];}];}一切似乎都运转良好。如果应用程序启动时

ios - 警告 : "implicit declaration of function ' .。 .' is invalid in C99"

当我尝试比较两个UIColors的RGB分量时收到此警告在.h文件中,我声明了这一点-(int)ColorDiff:(UIColor*)color1:(UIColor*)color2;在.m文件中-(int)ColorDiff:(UIColor*)color1:(UIColor*)color2{...//getRGBcomponentsfromcolor1&color2//computedifferencesofred,green,andbluevaluesCGFloatred=red1-red2;CGFloatgreen=green1-green2;CGFloatblue=blue1

ios - 无法从 Apple Developer Center 删除 App ID

我看到Apple在哪里更改了iOS开发中心的证书、标识符和配置文件页面,并在堆栈上阅读了这个问题/答案:RemovingAppIDfromDeveloperConnection但是我无法删除我想删除的几年前的AppID。“删除”按钮变灰/未启用。有人可以帮助我吗?我尝试了多种浏览器并清除了缓存,但无济于事。提前致谢!屏幕截图: 最佳答案 规则是,如果一个AppID曾经和一个App一起提交到商店,则不能删除(即使它没有被接受)。尚未提交应用的应用ID可自由删除。在Apple开发者论坛上查看此主题(您需要登录才能查看):https://

ios - XCode 5 GM 链接器错误 : too many compact unwind infos in function anon for architecture i386

我们刚刚更新到XCode5GM,一个在DP5下构建良好的项目(iPhone仅针对iOS7)现在出现错误:ld:in/Users/dan/Documents/Projects/ImageProApp/Pods/SparkInspector/SparkInspector.framework/SparkInspector(ExplorerViewState.o),toomanycompactunwindinfosinfunctionanonforarchitecturei386clang:error:linkercommandfailedwithexitcode1(use-vtoseeinv