Илья Седов: Как заставить программу под ios шевелиться?...

28

Upload: jetstyle

Post on 16-Jun-2015

435 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc
Page 2: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

Проектирование/исследованиеПрограммированиеОтладкаПрофилирование

Page 3: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

Профилированиеизмерениеправка одного места кодаитерация

Page 4: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc
Page 5: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

Например, смена ориентации устройства

Page 6: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

iOS 4.3Загрузка shouldAutorotateToInterfaceOrientation: shouldAutorotateToInterfaceOrientation: Поворот shouldAutorotateToInterfaceOrientation: willRotateToInterfaceOrientation:duration: willAnimateRotationToInterfaceOrientation:duration: didRotateFromInterfaceOrientation:

Page 7: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

iOS 5.1Загрузка shouldAutorotateToInterfaceOrientation: shouldAutorotateToInterfaceOrientation: shouldAutorotateToInterfaceOrientation: viewWillLayoutSubviews viewDidLayoutSubviews Поворот shouldAutorotateToInterfaceOrientation: willRotateToInterfaceOrientation:duration: viewWillLayoutSubviews viewDidLayoutSubviews willAnimateRotationToInterfaceOrientation:duration: shouldAutorotateToInterfaceOrientation: didRotateFromInterfaceOrientation:

Page 8: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

iOS 6.1Загрузка supportedInterfaceOrientations supportedInterfaceOrientations supportedInterfaceOrientations shouldAutorotate supportedInterfaceOrientations viewWillLayoutSubviews viewDidLayoutSubviews shouldAutorotate supportedInterfaceOrientations shouldAutorotate supportedInterfaceOrientations shouldAutorotate supportedInterfaceOrientations shouldAutorotate supportedInterfaceOrientations Поворот shouldAutorotate supportedInterfaceOrientations willRotateToInterfaceOrientation:duration: viewWillLayoutSubviews viewDidLayoutSubviews willAnimateRotationToInterfaceOrientation:duration: shouldAutorotate supportedInterfaceOrientations didRotateFromInterfaceOrientation:

Page 9: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

int main(int argc, char *argv[])

Page 10: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc
Page 11: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc
Page 12: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc
Page 13: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc
Page 14: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc
Page 15: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

Clean Dirty

Page 16: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc
Page 17: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

• Утечки памяти.• Заброшенная память.• Периодическое потребление памяти.

Page 18: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

Instruments: VM Tracker

Instruments: Allocations

+

Page 19: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

Instruments: Allocations

• Выделения памяти в куче

• Счетчик ссылок каждого объекта

• Heapshot анализ

Показывает:

Page 20: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

Instruments: Allocations

• Реальную картину потребления памяти

не показывает:

Page 21: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

Instruments: VM Tracker

• Страницы памяти

• Виртуальные зоны памяти

• Реальное потребление физической памяти

Показывает:

Page 22: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

Уменьшение потребления памяти

• избавляться от повторных выделений памяти (даже если это небольшие куски памяти)

• делать графику легче

Page 23: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc
Page 24: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

Интерфейс — это инструмент.

Page 25: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

Edward R. TufteThe Visual Display of Quantitative Information

Data-ink

Page 26: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

Edward R. TufteThe Visual Display of Quantitative Information

Above all else show the data.Maximize the data-ink ratio.

Erase non-data-ink.Erase redundant data-ink.

Revise and edit.

Page 27: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

Edward R. TufteThe Visual Display of Quantitative Information

Data-pixel

Page 28: Илья Седов: Как заставить программу под iOS шевелиться? #uwdc

Edward R. TufteThe Visual Display of Quantitative Information

It is all right to decorate construction but never construct decoration.