본문 바로가기

2017/10

[Android] finishAffinity 어플리케이션을 종료 하는 방법을 몇가지 블로그에 적어 놓은게 있다. http://gogorchg.tistory.com/entry/Android-%EC%96%B4%ED%94%8C%EB%A6%AC%EC%BC%80%EC%9D%B4%EC%85%98-%EA%BA%A0%EB%81%97%ED%95%98%EA%B2%8C-%EC%A2%85%EB%A3%8C%ED%95%98%EB%8A%94-%EB%B2%95 http://gogorchg.tistory.com/entry/Android-%EC%96%B4%ED%94%8C%EB%A6%AC%EC%BC%80%EC%9D%B4%EC%85%98-%EC%A2%85%EB%A3%8C System.exit 를 호출하여 종료 시키는 분들도 있으실 듯하다. 하지만, 이럴 경우 Android 내부에서 .. 더보기
[iOS] UITableView scroll to top UITableView이 Scroll을 최상위로 옮길 때 아래와 같은 소스 형태로 많이 할 것이다. 12let indexPath = IndexPath(row: 0, section: 0)self.tableView.scrollToRow(at: indexPath, at: .top, animated: false)cs 하지만, 저 같은 경우 가끔 TableView 첫번째 Cell만 정상 동작을 하지 않는 경우가 발생 하더라구요.갱신이 안되는 가장 많이 발생 했었습니다. 그래서, 여러 테스트를 해본 결과 아래 형태로 하면 해결 되더라구요. 12let indexPath = NSIndexPath(row: NSNotFound, section: 0)self.tableView.scrollToRow(at: indexPath a.. 더보기
[iOS] change TableHeaderView height dynamically with autolayout TableHeaderView에 높이가 바뀌었을 경우 해당 뷰 높이를 갱신 하더라도 TableHeaderView의 영역이 변하지 않아 어려움을 겪으신 분들은 아래 소스를 참조해보세요. 123456789101112if let headerView = tableView.tableHeaderView { let height = headerView.systemLayoutSizeFitting(UILayoutFittingCompressedSize).height var headerFrame = headerView.frame //Comparison necessary to avoid infinite loop if height != headerFrame.size.height { headerFrame.size.height = h.. 더보기
[iOS] initWithCoder unrecognized selector sent to instance Model을 만들어 사용할 때 아래 와 같은 에러가 나올 경우, [ModelVO initWithCoder:]: unrecognized selector sent to instance 한번 에러 나는 모델 소스가 아래와 같이 되어 있는지 확인 바란다. 12345678910111213141516171819202122232425import Foundation class ModelVO : NSObject { var num: Int var title: String init(qno: Int, question: String, answered: Int){ self.num = qno self.title = question self.answered = answered } required init(coder aDecoder:.. 더보기