IOS [[Tool Instance] getUser]引发的血案

来源:互联网 发布:伤感的网络歌曲有哪些 编辑:程序博客网 时间:2024/05/22 01:54
appGlobal 中 

self.user = [[ToolInstance]getUser];


怎么会界面全乱  我靠  你牛逼啊 按钮啥的都不见了 动画直接失效 报约束的错误

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) 

(

    "<NSLayoutConstraint:0x7913d990 H:[UIImageView:0x791414d0(-10.825)]>"

)


Will attempt to recover by breaking constraint 

<NSLayoutConstraint:0x7913d990 H:[UIImageView:0x791414d0(-10.825)]>


Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.

The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.


而getUser

-(User*)getUser

{

    NSUserDefaults * settings = [NSUserDefaultsstandardUserDefaults];

    NSData* d = [settings objectForKey:@"User"];

    User* user = [NSKeyedUnarchiverunarchiveObjectWithData:d];

    return user;

}

也就是读取一个缓存 什么都没干  以前好像也遇到过乱七八糟的问题 

百思不得其解  记录一下把  没法 把getUser换一个地方 哎  神奇的代码!

0 0