Tag: xcode

使用NSNotification将NSStringvariables传递给其他类

我想从一个类传递一个NSString到另一个类,并将NSString添加到我的第二个类中的一个NSMutableArray。 我相信我可以使用NSNotification这个,但我不知道如何通过一个variables通知。 我的代码是这样的: //class1.h #import <UIKit/UIKit.h> @interface ViewController : UIViewController @property(strong,nonatomic)NSString *variableString; @end //class1.m #import "ViewController.h" @interface ViewController () @end @implementation ViewController @synthesize variableString = _variableString; – (void)viewDidLoad { [super viewDidLoad]; [self setVariableString:@"test"]; [[NSNotificationCenter defaultCenter] postNotificationName: @"pasteString" object: _variableString]; // Do any additional setup after loading the view, typically from a nib. } – (void)viewDidUnload […]

Xcode 4.2 SIGABRT错误

每当我在iPad模拟器上运行我的应用程序时,它都可以正常工作。 但是,当我在iPhone模拟器上运行它,当我点击主页button时,我的main.m文件中的Xcode出现错误,说:“线程1:程序接收信号:SIGABRT”。 在main.m的代码中突出显示了这一行: return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 当我按下iPad模拟器上的主页button时,不会发生这个问题。 我在这里做了很多关于这个错误的研究,但似乎没有什么用处。 有谁知道如何去解决这个问题? 编辑:这是来自debugging器控制台的更多信息 “无法在引导程序服务器上注册None.TestApplication。错误:未知的错误代码。这通常意味着该进程的另一个实例已经在运行,或者挂载在debugging器中.sharedlibrary apply-load-rules all当前语言:auto;目前的Objective-C(GDB)

升级到xcode 4.6和iOS 6.1后出错“,用作前一个参数的名称而不是select器的一部分”

更新到xcode 4.6和ios6.1之后,我得到这个新的错误“'objectType'作为前一个参数的名称,而不是作为select器的一部分 ”。 我多次得到这个。 有任何想法吗? PS:它显示的方法是用于反向地理编码的自定义方法。 -(void) getAddress: (NSString *) objectType: (CLLocationCoordinate2D) objectCoordinate

UITextField文本每隔一个按键就会消失

这是一个现象的video:http: //youtu.be/c0TP8YVF9TE 如video所示,exampleTextView.text中的值不会丢失。 它只是隐藏每隔一个按键。 解决scheme尝试:我没有设置exampleTextView.text值在程序中的东西,除了按下返回键(和注释该线路没有改变什么)。 我已经设定: self.exampleTextView.clearsOnBeginEditing=NO; self.exampleTextView.clearsContextBeforeDrawing=NO; self.exampleTextView.clearsOnInsertion=NO; 编辑:这是我的代码: https : //gist.github.com/andrewschreiber/6970283

“初始化元素不是编译时常量”为什么?

我有这个代码: – (NSString *) calculate: (uint) position { static NSArray * localArray = [NSArray arrayWithArray: self.container.objects ]; // some un related code return obj; } 编译器抱怨说:“初始化元素不是编译时常量”。 当我添加“静态”localArray时发生。 但为什么?

错误在Xcode 6 – 视图控制器没有名为(子视图)的sockets

我刚刚在我的一个应用程序中遇到了这个错误,在检查了一些其他应用程序之后,也出现了同样的错误。 我的IBOutlets和IBActions都没有连接了。 当我通过控制拖入.h文件重新创buildsockets时,sockets仍然在Connections Inspector> Outlets中显示错误,并说(视图控制器)没有名为(subview)的sockets。 在今天之前,我没有这个问题,那么与Xcode 6呢? 视图控制器正在引用Identity Inspector> Custom Class下的正确类。 我删除了派生的数据文件夹,删除了对.h文件的引用,清理了项目,并清除了构build文件夹。 这一切都没有奏效,在这个问题得到解决之前,我无法继续发展。 更新:几天后,我刚刚重新打开了项目,我的店铺旁边不再有惊叹号,我断开的“easyLabel”sockets又重新出现了。 我没有改变任何东西,所以我猜这是Xcode 6-6.1中的一个bug。 更新2:这个错误回来了。 每个sockets旁边都有感叹号。 如果我删除它们,我不能重新添加它们。 无法创build新的网点。 也不能给视图控制器一个自定义的类。 我真的只想在应用程序上取得一些进展,但这个问题不断重演。 真的再也忍受不了了。 任何帮助,将不胜感激。

从文档目录加载图像

我不能让我的图像(.png)显示。 我检查它存在于我使用的path,它确实存在。 但是没有图像出现。 这是我一直在尝试的: NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDir = [documentPaths objectAtIndex:0]; NSString *outputPath = [documentsDir stringByAppendingPathComponent:[fileList objectAtIndex:indexPath.row]]; NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease]; NSString *imgPath = [[outputPath stringByReplacingOccurrencesOfString:@"mov" withString:@"png"]retain]; if ([fileManager fileExistsAtPath:imgPath]) { NSLog(@"FOUND IMG"); NSLog(imgPath); } NSData *imgData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:imgPath]]; UIImage *thumbNail = [[UIImage alloc] initWithData:imgData]; […]

尝试将存档提交到App Store时出现各种ITMS错误

所以这是一个奇怪的 – 尝试将我的存档提交给App Store时出现以下错误: ERROR ITMS-90049: "This bundle is invalid. The bundle identifier contains disallowed characters. [See the section of the Application Programming Guide entitled The APplication Bundle.]" ERROR ITMS-90049 "This bundle is invalid. The bundle identifier contains disallowed characters ERROR ITMS-90056: "This bundle is invalid. The Info.plist file is missing the required key: CFBundleVersion." […]

模拟指标有什么影响?

使用.xib文件时,对代码/应用程序的改变会对模拟指标有什么影响? 还是只是为了您的利益作为预览工具?

估计的app store大小

归档应用程序后。 版本和组织者窗口中有一个button,点击它计算并显示应用程序的估计大小。 在商店。 在以后的Xcode版本6.2中,该button消失了! 是否还有一种方法来了解估计的应用程序。 尺寸?