Tag: iphone

UITableView / UITableViewCell点击事件响应?

我一直在用googlesearch,试图找出什么样的事件句柄被称为UITableView中的一行(或单元格)被挖掘,但一直无法弄清楚。 我试图改变单元格的图像属性,当它被点击。 谢谢。

将NSIntegervariables传递给NSMutableDictionary或NSMutableArray

为什么这不起作用: NSInteger temp = 20; [userSettingsFromFile setObject:temp forKey:@"aTemp"]; 但是这样做: [userSettingsFromFile setObject:@"someObject" forKey:@"aTemp"]; 我怎样才能使用NSIntegervariables?

Core-Data iPhone:找不到NSManagedObjectModel

我正在使用Apple的CoreDataBooks示例项目作为核心数据的学习辅助工具。 我修改了应用程序,以便应用程序加载时,我首先显示一个菜单页面 – 而不是书籍tableview(RootViewController)。 我做了以下几件事: 我在界面生成器中创build了一个菜单页面(只是一个带有button的视图) CoreDataBooksAppDelegate.h现在看起来像这样: // for the menu @class MenuViewController; @interface CoreDataBooksAppDelegate : NSObject <UIApplicationDelegate> { NSManagedObjectModel *managedObjectModel; NSManagedObjectContext *managedObjectContext; NSPersistentStoreCoordinator *persistentStoreCoordinator; UIWindow *window; UINavigationController *navigationController; //for the menu MenuViewController *viewController; } – (IBAction)saveAction:sender; //for the menu @property (nonatomic, retain) IBOutlet MenuViewController *viewController; @property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel; @property (nonatomic, retain, […]

iPhone – 在导航控制器中replacerootview

我有一个NavigationController的项目,包含到IB显示的第一个ViewController。 这只是创build项目时的默认模式。 在那第一个viewController中,我收到了一些事件,我发送到appDelegate,我想它用另一个replacerootview。 不要去下一个。 所以我这样做: – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // Add the navigation controller's view to the window and display. self.window.rootViewController = self.navigationController; [self.window makeKeyAndVisible]; return YES; } – (void) goNext { [self.navigationController popViewControllerAnimated:NO]; NextViewController* nextWindow = [[[NextViewController alloc] initWithNibName:@"NextView" bundle:nil] autorelease]; [self.navigationController pushViewController:nextWindow animated:NO]; […]

创build一个水平线

我有两个标签堆叠。 如果我想要它们之间的水平线,除了与UIImageView使用图像有什么其他的方式吗?

黑屏而不是iPad上的启动图像

我正在开发iOS 6.1和7(使用Xcode 5)的iPhone应用程序。 我有一个iPad启动图像的问题。 在iPad 7.0和7.0.2上,启动图像没有显示出来(在6.1版本中):我在加载应用程序时出现黑屏。 尽pipe我设置了iPad和iPad视网膜(横向和纵向)所需的所有启动图像,并使用资源目录,但我并不面临iPhone 6.1和7.0.2的这个问题。 我错过了什么?

字体大小以像素为单位

在iPhone上,如何计算给定磅值的字符大小(以像素为单位)?

iOS 6.1和Xcode 4.6,Enumeration警告UIViewAnimationCurveEaseOut

我已经安装了新的iOS 6.1和Xcode 4.6,现在我有我的代码枚举警告,我无法解决这个问题: [UIView animateWithDuration:0.4 delay:0.0 options:UIViewAnimationCurveEaseOut animations:^{ } completion:^(BOOL finished) {}]; 这是警告: Implicit conversion from enumeration type 'enum UIViewAnimationCurve' to different enumeration type 'UIViewAnimationOptions' (aka 'enum UIViewAnimationOptions') 我怎么能解决这个警告?

深度可变的NSMutableDictionary副本

我想创build一个NSMutableDictionary深层副本,并将其分配给另一个NSMutableDictionary。 字典包含一堆数组,每个数组包含名字,而键是一个字母表(这些名字的第一个字母)。 所以词典中的一个词是'A' – >'Adam','Apple'。 这是我在书中看到的,但我不确定它是否工作: – (NSMutableDictionary *) mutableDeepCopy { NSMutableDictionary * ret = [[NSMutableDictionary alloc] initWithCapacity: [self count]]; NSArray *keys = [self allKeys]; for (id key in keys) { id oneValue = [self valueForKey:key]; // should return the array id oneCopy = nil; if ([oneValue respondsToSelector: @selector(mutableDeepCopy)]) { oneCopy = [oneValue mutableDeepCopy]; } […]

最快的方式在iOS上做阴影?

QuartzCore .layer.shadow的吸收性能。 他们似乎需要每次改变时重新渲染,导致一切都滞后。 Coregraphics渐变(单向阴影) – 看起来不正确。 如果你的渐变从0.3阿尔法到0,它有一些奇怪的效果,你可以看到它停止。 这只是不好看,或自然。 也许它没有抖动,但我敢肯定,我听说核心graphics渐变是。 这很奇怪,我不知道。 Coregraphics阴影 – 需要一段时间才能渲染,但其他方面performance不错。 只是等待一个观点出现,因为它必须首先渲染阴影,这就是问题所在。 所以我一定会错过一些东西。 有没有另外一种方法看起来正确,并且在渲染时间和性能上都很快?