Tag: 目标C

iOS DidMoveToWindow无限循环

我正在研究iOS NUI框架的源代码。 我发现了下面这行代码,但是我不知道它是如何工作的 – (void)override_didMoveToWindow { if (!self.isNUIApplied) { [self applyNUI]; } [self override_didMoveToWindow]; } 只是为了清楚起见,他们用这个方法debugging了DidMoveToWindow的原始实现,以便在运行时应用类/样式。 令我困惑的是上面的函数从来没有造成任何死循环。

Facebook SDK的iOS – 授权应用程序内?

我发现在Facebook.m类中我可以这样做: [self authorizeWithFBAppAuth:NO safariAuth:NO]; 我将其中的每一个都从YES更改为NO,因为我不想让用户离开我的应用程序来授权我的应用程序。 不过,现在我没有得到任何types的应用内授权,所以如何在我的应用程序内授权我自己,而不需要用户去Safari或Facebook应用程序授权呢? 谢谢。

在使用storybaords时,需要以编程方式调整子视图的大小?

我对自定义视图非常熟悉。 今天我开始使用故事板,我无法说服自己使用故事板。 问题: – 我已经通过视图控制器设置故事板。 – 在模拟器上运行4英寸,我很好与视图的布局。 – 在模拟器上运行3.5英寸,我很难过,因为我的观点是部分可见的。 这里是屏幕截图。 我的SotryBaord(看“删除用户”button)。 删除用户button框架: 在模拟器上运行4英寸 在模拟器上运行4英寸 (我有问题) 我如何获得调整了布局的框架,以便在两个尺寸的iPhone中都能够清晰地运行。 我的删除用户button不应该离开屏幕。

一些代码不在另一个ViewController调用的方法中执行

我的问题 我有一个标准的UIViewController 。 通过按下button,它会加载一个表单模式视图控制器。 当按UIBarButtonItem解除这个模式视图时,我通过执行下面的方法来调用一个方法: ViewController *main = [[ViewController alloc] initWithNibName:nil bundle:nil]; [main updateLabel]; 在方法-(void)updateLabel在主ViewController我设置标签的文本,但标签不会改变。 但我知道函数被调用,因为如果我做一个NSLog(@"Method call test);而不是label.text = @"Test"我可以在控制台中看到消息。 我究竟做错了什么? 它必须是我在主ViewController调用方法的方式,因为我可以在其他地方轻松更改标签。 我想做的事: closures模式视图控制器时,我想在主视图控制器中调用一个方法,在这种情况下更改标签的文本。 谢谢你的帮助!

Xamarin Studio iOS程序集错误

当我更新我的Xamarin工作室(iOS)时,它会给我这个错误,当试图build立/debugging。 我不知道如何解决这个问题,将不胜感激一些帮助 错误: The type 'MonoTouch.UIKit.UIView' is defined in an assembly that is not referenced. Consider adding a reference to assembly 'monotouch, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' 我正在使用“AlexTouch.MBProgressHUD.dll”,我已经添加到我的使用。

使用后端Spring Security Java EE服务器和前端iOS Objective-C客户端进行身份validation

我想validation在Java EE服务器后端连接到他的iOS应用程序上的用户。 在这里,你可以find我的spring安全configuration后端: <?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> <http auto-config="true" use-expressions="true"> <intercept-url pattern="/home.mediator" access="permitAll" /> <intercept-url pattern="/loginInvalid.security" access="permitAll" /> <intercept-url pattern="/logout*" access="permitAll" /> <intercept-url pattern="/user**" access="hasRole('ROLE_USER')"/> <intercept-url pattern="/admin**" access="hasRole('ROLE_ADMIN')"/> <intercept-url pattern="/*" access="isAuthenticated()" /> <form-login login-page="/home.mediator" default-target-url="/loginValid.security" authentication-failure-url="/loginInvalid.security" /> <logout invalidate-session="true" logout-success-url="/logoutSuccess.security" logout-url="/logout.do"/> </http> <authentication-manager> <authentication-provider […]

什么是CFNotificationCentercallback函数观察者?

我是CFNotificationCenter的新手。 我正在阅读developer.apple上的文档,它说在CallbackFunction中,观察者是“非NULL的任意值来标识观察者”。 观察者是否可以成为一个对象,以便我可以在callback函数中访问它的方法? 这些是文档中显示的参数。 void MyCallBack ( CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo ); 另一个问题。 为什么添加观察者时允许观察者为零? void CFNotificationCenterAddObserver ( CFNotificationCenterRef center, const void *observer, CFNotificationCallback callBack, CFStringRef name, const void *object, CFNotificationSuspensionBehavior suspensionBehavior ); “观察者,在OS X v10.3及更高版本中,这个参数可能是NULL。”

SDL2_ttf不会在ios上运行

所以情况是 – 我下载了最新的SDL2_ttf库,打开了包含在包中的XCode-IOS项目,没有任何问题地构build它,并连接到我的项目。 一切编译和运行,但在开始我的程序退出输出消息: apinames 0.1: extract FreeType API names from header files this program is used to extract the list of public FreeType API functions. It receives the list of header files as argument and generates a sorted list of unique identifiers usage: apinames header1 [options] [header2 …] options: – : parse the content […]

使用MonoTouch.CoreText在特定的坐标上绘制文本片段

我正在尝试获取CoreText的帮助,从http://docs.xamarin.com/recipes/ios/graphics_and_drawing/core_text/draw_unicode_text_with_coretext/ 作为一个testing,我想写在“N”,“E”,“S”和“W”的视图在各自的立场。 但是只有第一个('N')被绘制。 这是我的版本的TextDrawingView.cs: using System; using System.Drawing; using MonoTouch.UIKit; using MonoTouch.Foundation; using MonoTouch.CoreText; using MonoTouch.CoreGraphics; namespace CoreTextDrawing { public class TextDrawingView : UIView { public TextDrawingView () { } //based upon docs.xamarin.com/recipes/ios/graphics_and_drawing/\ // core_text/draw_unicode_text_with_coretext/ public override void Draw (RectangleF rect) { base.Draw (rect); var gctx = UIGraphics.GetCurrentContext (); gctx.SetFillColor (UIColor.Green.CGColor); DrawText ("N", Bounds.Width / […]

修改特定的UIWebView代码以使地址栏与Safari类似

我已经使用PhoneGap构build了一个应用程序,并使用其InAppBrowser插件。 对于iOS平台,InAppBrowser是使用UIWebView实现的。 “地址栏”是一个简单的UILabel,所以它基本上是从用户的angular度来看的。 我想扩展插件有一个简单的function地址栏。 您知道,让用户input新的url,并显示less量内联刷新和去button。 基本上像移动Safari,Chrome等常规浏览器 我知道99种编程语言,但Objective-C不是其中之一。 :(大多数情况下,我没有使用iOS框架的经验。 这些假设对我来说太多了: 具有地址栏的iOS WebView 将一个标题视图添加到类似于Safari和Articles的UIWebView 我想只修改PhoneGap插件 iOS源码本身,这样我就可以保持它提供给我的PhoneGap应用程序的JavaScript的插件钩子。 这里是两个相关的文件: 在Github上的CDVInAppBrowser.h和CDVInAppBrowser.m 希望对已经熟练使用Objective-C和iOS的人来说,这是一个令人欢迎的挑战? 或者,也许你可以加快我自己做出改变? 谢谢!! 所以你可以看到当前的UIWebView(使用UILabel for Address):