以下是我在调试区域收到的错误消息.它运行正常,没有任何错误,除了我收到此错误.这会阻止苹果接受应用吗?我如何解决它?
2012-07-26 01:58:18.621 Rolo[33597:11303] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x887d630 h=--& v=--& V:[UIButtonLabel:0x886ed80(19)]>",
"<NSAutoresizingMaskLayoutConstraint:0x887d5f0 h=--& …
Run Code Online (Sandbox Code Playgroud) 这是在我的.m
- (void)viewDidLoad
{
[super viewDidLoad];
[self.scrollView addSubview:self.contentView];
self.scrollView.contentSize = self.contentView.bounds.size;
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
NSMutableArray *arr = [[NSMutableArray alloc]init];
arr = [Singleton getArray];
NSString *str = [arr componentsJoinedByString:@"\n"];
summaryLabel.text = str;
}
Run Code Online (Sandbox Code Playgroud)
这是我的.h
@interface TotalViewController : UIViewController
{
UIScrollView *scrollView;
UIView *contentView;
}
@property (nonatomic, retain) IBOutlet UIScrollView * scrollView;
@property (nonatomic, retain) IBOutlet UIView * contentView;
@property (nonatomic,strong) IBOutlet UILabel * summaryLabel;
Run Code Online (Sandbox Code Playgroud)
我的标签连接到视图控制器,我的contentView连接到视图控制器,我的summaryLabel连接到视图控制器.我需要标签滚动而不是.
thread 1: EXC_BAD_ACCESS (code=1, address = 0x70
当我在我的时候,我得到以下错误消息addCustomerViewController
,或者单击保存,在代码运行结束时self.navigationController!.popViewControllerAnimated(true)
,或者当我单击相同时addCustomerViewController
.用错误突出显示的代码行在我的AppDelegate类中,它的第一行如下所示
class AppDelegate: UIResponder, UIApplicationDelegate{
Run Code Online (Sandbox Code Playgroud)
这是我在调试区域中获得的最后一条消息.不确定它是否相关.
2015-06-17 23:03:03.744 SalesCRM[4930:1409291] CoreData: error: Failed to call designated initializer on NSManagedObject class 'Customer'
Run Code Online (Sandbox Code Playgroud)
这是保存功能.让我知道您可能需要查看的其他代码.我迷失了如何解决这个问题.
@IBAction func save(sender: AnyObject) {
let appDel:AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
let context:NSManagedObjectContext = appDel.managedObjectContext
if firstName.text != "" && lastName.text != "" && phoneNumber.text != ""
{
let newUser = NSEntityDescription.insertNewObjectForEntityForName("Customer", inManagedObjectContext: context) as NSManagedObject
newUser.setValue(firstName.text?.lowercaseString, forKey: "firstName")
newUser.setValue(lastName.text?.lowercaseString, forKey: "lastName")
newUser.setValue(phoneNumber.text, forKey: "phoneNumber")
newUser.setValue(email.text, …
Run Code Online (Sandbox Code Playgroud) 我在创建程序时使用的是Xcode 4.5 Beta 3.当我尝试切换到Xcode 4.4时,它给出了以下错误.如何在此版本的xcode中使用它.
The document "MainStoryboard.storyboard" could not be opened. This version of Xcode does not
support Auto Layout for iOS documents.
Run Code Online (Sandbox Code Playgroud) 这行代码在我的电子邮件文本字段编辑DidEnd 时运行。NSLog 运行,所以我知道该函数已运行,但键盘仍然没有消失。我已将文本框连接为委托。我已经确保故事板中的连接存在。依然不会改变。帮助。谢谢。
- (IBAction)emailDone2:(id)sender
{
[_email resignFirstResponder];
NSLog(@"emailDone2");
}
Run Code Online (Sandbox Code Playgroud)
编辑* *我按照指示更改了代码,但这仍然没有任何作用。什么也没有变。
- (IBAction)emailDone2:(id)sender
{
[self.view endEditing:TRUE];
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试从表格视图切换到详细视图.当我点击单元格时它会崩溃.我已经使用了休息来尝试找到它崩溃的代码,但我找不到特定的行.当从表视图到详细视图执行segue时,它会崩溃.我想将一些变量传递给详细视图但我首先需要让它切换到详细视图.我正在使用故事板fyi.任何帮助,将不胜感激.
更新:崩溃日志如下
arg c = (int) 1
arg v = (char **) 0x2fd63cdc
Run Code Online (Sandbox Code Playgroud)
这就是崩溃的路线
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
Run Code Online (Sandbox Code Playgroud)
更新2
当我逐步完成代码时崩溃之前的最后一段代码就是为segue函数做准备.在那里的最后一行代码之后它崩溃并转到上面的一行.
更新3
我意识到控制台已被隐藏,因此这是控制台中显示的错误.我的两个准备segue的nslog都被调用了.
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<DetailViewController 0x1e098bd0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key name.'
*** First throw call stack:
(0x3a1e63e7 0x39072963 0x3a1e60d5 0x3a418fe9 0x3a414d53 0x3a16c8a5 0x39665d7d 0x396655ff 0x3955e039 0x394e8421 0x3953d1b7 0x3953d0fd 0x3953cfe1 0x3953cf0d 0x3953c659 0x3953c541 0x3952ab33 0x3952a7d3 0x3958b2ad 0x3960dca1 0x3a4b9e67 0x3a1bb857 0x3a1bb503 0x3a1ba177 0x3a12d23d 0x3a12d0c9 0x3746633b 0x3951d291 0x69a9 …
Run Code Online (Sandbox Code Playgroud) ios ×5
appdelegate ×1
core-data ×1
debugging ×1
ios6 ×1
ios7 ×1
objective-c ×1
singleton ×1
storyboard ×1
swift ×1
tableview ×1
uitableview ×1