针对iPhonetesting的通用iPhone / iPad应用程序debugging编译错误

我写了一个iPhone和iPad的通用应用程序,它可以在Xcode的iPad模拟器上正常运行,但我现在想testingiPhone的function。 我似乎无法运行这个代码的iPhone模拟器,因为它总是默认为iPad? 相反,我试图在设备上运行,并开始运行时出现以下错误: dyld: Symbol not found: _OBJC_CLASS_$_UISplitViewController Referenced from: /var/mobile/Applications/9770ACFA-0B88-41D4-AF56-77B66B324640/Test.app/Test Expected in: /System/Library/Frameworks/UIKit.framework/UIKit in /var/mobile/Applications/9770ACFA-0B88-41D4-AF56-77B66B324640/Test.app/TEST 由于应用程序是以编程方式构build的,而不是使用XIB,所以我使用main.m方法中的以下几行分割了2个设备逻辑: if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate_Pad"); } else { retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate_Phone"); } 从这一点出发,他们使用不同的AppDelegates,我已经检查了我的头文件,以确保UISplitView永远不会被使用,也不会通过Phone逻辑导入。 我如何避免这个错误,是否有更好的方法来拆分这个程序创build的应用程序中的通用逻辑path?

正确的单例模式Objective C(iOS)?

我在网上发现了一些使用GCD创build单例类的信息。 这很酷,因为它是线程安全的,开销很低。 可悲的是我找不到完整的解决scheme,但只有片段的sharedInstance方法。 所以我用自己的试错法做了我自己的课 – 等等,下面出来: @implementation MySingleton // MARK: – // MARK: Singleton Pattern using GCD + (id)allocWithZone:(NSZone *)zone { return [[self sharedInstance] retain]; } – (id)copyWithZone:(NSZone *)zone { return self; } – (id)autorelease { return self; } – (oneway void)release { /* Singletons can't be released */ } – (void)dealloc { [super dealloc]; […]

Sqlite文件位置核心数据

通常,核心数据应用程序的sqlite存储文件位于 库>应用程序支持> iPhone模拟器> 7.1(或您正在使用的版本)>应用程序>(无论哪个文件夹包含您的应用程序)>文档 文件夹,但我不能在IOS 8中find它。我假设他们只会在iPhone模拟器文件夹中添加一个8.0文件夹,但它不在那里。 有人能find它吗?

放松Segue不在iOS 8中工作

我有一个应用程序,可以在iOS 7下正常工作,但是当为iOS 8构build时,展开的segues不起作用。 我创build了一个新项目,并添加了一个模式(导航控制器与tableviewcontroller),并试图使用unwind模式。 不幸的是它也不起作用。 正在放松的方法是在desination视图控制器中。 展开的segue是通过故事板创build的(tableviewcontroller中的一个导航栏button)当我点击button时,没有任何反应。 没有日志输出,模式不会消失。 它也似乎只影响模态赛段。 推/ popover正常展开。 有没有人有类似的问题,有一个想法,我怎么能解决它?

我如何pipe理构buildiPhone应用程序的精简版和付费版本?

我开始想要考虑构build我的iPhone应用程序的精简版。 我在网上发现了一些关于这个过程的内容,即: http://developer.apple.com/tools/XCode/XCodeprojects.html http://www.pacificspirit.com/blog/2009/01/27/building_for_multiple_iphone_targets_in_xcode 我特别感兴趣的是简化pipe理哪些文件包含在我的应用程序的不同版本中的过程,因为我不断修改和增强付费版本。

是否可以使用sharedHTTPCookieStorage为UIWebView手动设置Cookie?

我有一个iOS应用程序内的webviews,需要一个身份validationcookie进行正确的身份validation。 我正在寻找一种方法来设置一个iOS应用程序的web视图内的cookie,而不必做一个出站请求来设置cookie,因为我已经在客户端的身份validation信息。 这篇文章向我们展示了UIWebView cookie的存储位置。 现在我正在加载一个隐藏的Web视图来发出一个出站请求,但是不希望做出设置一个简单的cookie的外部请求。

从圆圈或圆环画出细分

我一直在试图找出一种方法来绘制段如下图所示: 我想: 绘制段 包括渐变 包括阴影 从0到n的angular度animation绘图 我一直在尝试使用CGContextAddArc和类似的调用来做到这一点,但没有得到很大的进展。 谁能帮忙?

如何在目标c中使用XMLparsing来发布带有特殊字符和泰语的string

我是新来的ios和我面临的问题,包括特殊字符后的string。 我的代码是这样在DidFinishLoading: NSXMLParser *myNSXMLParserPostObj=[[NSXMLParser alloc]initWithData:myNSMDataPostFromServer]; myNSXMLParserPostObj.delegate=self; [myNSXMLParserPostObj parse]; NSLog(@"%@",myNSXMLParserPostObj.parserError); NSString *responseStringWithEncoded = [[NSString alloc] initWithData: myNSMDataPostFromServer encoding:NSUTF8StringEncoding]; //NSLog(@"Response from Server : %@", responseStringWithEncoded); NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[responseStringWithEncoded dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil]; serverResponse.attributedText = attrStr; NSString *Str =serverResponse.text; NSLog(@"Server Response =%@",Str); UIAlertView *alert3 = [[UIAlertView alloc] initWithTitle:@"Success" message:@"Complaint Added Successfully" […]

来自NSDate的意外值

我试图在一个date存储一个时间。 在这种情况下1.5秒。 我把时间存储在这样的date: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"mm:ss.SS"]; [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0.0]]; NSDate *date1 = [dateFormatter dateFromString:@"00:01.50"]; 但是,如果我看在debugging区域,我可以看到date1的值设置为: date1 = (NSDate *) 0x1dd32b30 2000-01-01 01:00:01 CET 谁能告诉我为什么会发生这种情况?

Objective C NSString *属性保留奇数

我有以下的例子类: Test.h: @interface Test : UIButton { NSString *value; } – (id)initWithValue:(NSString *)newValue; @property(copy) NSString *value; Test.m: @implementation Test @synthesize value; – (id)initWithValue:(NSString *)newValue { [super init]; NSLog(@"before nil value has retain count of %d", [value retainCount]); value = nil; NSLog(@"on nil value has retain count of %d", [value retainCount]); value = newValue; NSLog(@"after init […]