1,设置Product -> Edit Scheme -> Environment Variables
NSZombieEnabled YES
MallocStackLogging YES
NSAutoreleaseFreedObjectCheckEnabled
NSDebugEnabled
numberOfRowsInSection 打印值,如果没有就是TableView没有初始化。
★ viewDidAppear调用
5.0以后会自动调用,4.3需要强制调用。
★ Crash
Organizer -> Console
Mar 28 16:36:25 unknown iAlumni[1856]
★ Login的独立
//- (void)openLogin
//{
//
// LoginViewController *mLoginController = [[[LoginViewController alloc] initWithMOC:managedObjectContext] autorelease];
// homeNavVC.navigationBar.tintColor = TITLESTYLE_COLOR;
// [homeNavVC presentModalViewController:mLoginController animated:YES];
//
//}
- (void)openLogin
{
LoginViewController *mLoginController = [[LoginViewController alloc] initWithMOC:managedObjectContext];
UINavigationController *homeNav = [[UINavigationController alloc] initWithRootViewController:mLoginController];
self.window.rootViewController = homeNav;
homeNav.navigationBarHidden = YES;
[self.window makeKeyAndVisible];
[self.window addSubview:homeNav.view];
RELEASE_OBJ(mLoginController);
RELEASE_OBJ(homeNav);
}
★ void SendDelegateMessage(NSInvocation*): delegate (webView:decidePolicyForNavigationAction:request:frame:decisionListener:) failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode
★ Apr 6 18:32:59 unknown iAlumni[80]
★ 单个navigationController回到主界面
[self.navigationController popToRootViewControllerAnimated:YES];
★ 真机调试
error: failed to launch '/Users/Adam/Library/Developer/Xcode/DerivedData/iAlumni-evlhawkehmiqrzacwjvtozfzhkcx/Build/Products/Debug-iphoneos/iAlumni.app/iAlumni' -- No such file or directory (/Users/Adam/Library/Developer/Xcode/DerivedData/iAlumni-evlhawkehmiqrzacwjvtozfzhkcx/Build/Products/Debug-iphoneos/iAlumni.app/iAlumni)
★ 页面偏转
aVC -> bVC
下面两种方式,返回时aVC不会调用init.
aVC:[self.navigationController pushViewController:groupListVC animated:NO];
bVC:back button
aVC:[self presentModalViewController:helpVC animated:NO];
bVC:[self dismissModalViewControllerAnimated:YES];
★ 等比例缩放
UIImageView *showImageView = [[[UIImageView alloc] initWithFrame:mImgFrame] autorelease];
showImageView.contentMode = UIViewContentModeScaleAspectFit;
★ 安装新版本闪退
通过浏览器Safari一次更新ok,二次下载企业级应用,Crash log:
Apr 10 10:23:47 unknown SpringBoard[28]
企业版本更新,在程序里面进行,而非通过;页面更新。
★ 安装新版本闪退
-[CALayer retain]: message sent to deallocated instance 0xcfbda30
查找下面关键词,看看是否存在二次释放。
autorelease
release
RELEASE_OBJ
★ Xcode symbol not found
工程的索引文件损坏,删掉下面目录里面的文件
/Users/Adam/Library/Developer/Xcode/DerivedData
★ 拒绝父类颜色
self.view.backgroundColor = [UIColor clearColor];
★ UIButton丰富展现
_authorImageBackgroundView = [[UIView alloc] initWithFrame:CGRectMake(MARGIN * 2,
MARGIN * 2,
POSTLIST_PHOTO_WIDTH,
POSTLIST_PHOTO_HEIGHT)];
_authorImageBackgroundView.backgroundColor = [UIColor clearColor];
UIBezierPath *shadowPath = [UIBezierPath bezierPath];
[shadowPath moveToPoint:CGPointMake(2, 2)];
[shadowPath addLineToPoint:CGPointMake(POSTLIST_PHOTO_WIDTH + 1, 2)];
[shadowPath addLineToPoint:CGPointMake(POSTLIST_PHOTO_WIDTH + 1, POSTLIST_PHOTO_HEIGHT + 1)];
[shadowPath addLineToPoint:CGPointMake(2, POSTLIST_PHOTO_HEIGHT + 1)];
[shadowPath addLineToPoint:CGPointMake(2, 2)];
[shadowPath addArcWithCenter:CGPointMake(POSTLIST_PHOTO_WIDTH/2 + 2, POSTLIST_PHOTO_HEIGHT/2 + 2)
radius:PHOTO_SIDE_LENGTH/2
startAngle:2 * M_PI
endAngle:0
clockwise:true];
_authorImageBackgroundView.layer.shadowPath = shadowPath.CGPath;
_authorImageBackgroundView.layer.shadowColor = [UIColor darkGrayColor].CGColor;
_authorImageBackgroundView.layer.shadowOpacity = 0.9f;
_authorImageBackgroundView.layer.shadowOffset = CGSizeMake(0, 0);
_authorImageBackgroundView.layer.masksToBounds = NO;
[self.contentView addSubview:_authorImageBackgroundView];
_authorImageButton = [UIButton buttonWithType:UIButtonTypeCustom];
_authorImageButton.frame = CGRectMake(0, 0, POSTLIST_PHOTO_WIDTH, POSTLIST_PHOTO_HEIGHT);
_authorImageButton.layer.cornerRadius = 6.0f;
_authorImageButton.layer.masksToBounds = YES;
_authorImageButton.layer.borderWidth = 2.0f;
_authorImageButton.layer.borderColor = [UIColor whiteColor].CGColor;
_authorImageButton.showsTouchWhenHighlighted = YES;
[_authorImageButton addTarget:self action:@selector(openProfile:) forControlEvents:UIControlEventTouchUpInside];
[_authorImageBackgroundView addSubview:_authorImageButton];
★ [self performSelector:@selector(doNext) withObject:nil afterDelay:0.01f];
☆TASK:
BaseUITableViewCell 整合 ECTextBoardCell
★
self.view.frame.size.width
LIST_WIDTH
★ /* Calculate screen size */
CGRect screenFrame = [[UIScreen mainScreen] applicationFrame];
★ 自定义UITableViewCell怎样在子控件触发时得到indexPath
NSIndexPath *indexPath = [_tableView indexPathForCell:(UITableViewCell *)[sender superview]];
UITableViewCell *cell = [_tableView cellForRowAtIndexPath:indexPath];
[as showFromRect:cell.bounds inView:cell animated:TRUE];
★ presentModalViewController
UserDetailViewController *userProfileVC = [[UserDetailViewController alloc] initWithPersonIdByNet:CLUB_USER_TY needAddContact:YES personId:userId personType:userType];
UINavigationController *navigationView = [[UINavigationController alloc] initWithRootViewController:userProfileVC];
navigationView.navigationBar.tintColor = TITLESTYLE_COLOR;
userProfileVC.MOC = _MOC;
userProfileVC.title = LocaleStringForKey(NSUserProfileTitle, nil);
[self presentModalViewController:navigationView animated:YES];
RELEASE_OBJ(userProfileVC);
RELEASE_OBJ(navigationView);
mNC.modalPresentationStyle = UIModalPresentationCurrentContext;
mNC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;