卤煮刚被web大潮淘汰到ios,当听说写oc要手动释放内存的时候如丧考妣,不过幸运的是ARC来了,妈妈再也不用担心我内存泄漏了。不过根据卤煮多年开发经验,和内存相关的不可能没有坑,开心之余还是得了解下oc是怎么搞内存的。
[TOC]
OC对象都有一个属性 retainCount
表明这个对象还有几个引用, 当retainCount为0, 说明这个对象没人用了,runtime就会回收掉。而所谓的内存泄漏就是明明没人用了,retainCount却不是0,runtime没有回收掉这个对象。
# Automaticlly install pptpd on Amazon EC2 Amazon Linux | |
# | |
# Ripped from http://blog.diahosting.com/linux-tutorial/pptpd/ | |
# pptpd source rpm packing by it's authors | |
# | |
# WARNING: | |
# first ms-dns setting to 172.16.0.23, 172.16.0.23 was showing on my | |
# /etc/resolv.conf, I'm not sure this is the same on all Amazon AWS zones. | |
# | |
# You need to adjust your "Security Groups" which you are using too. |
// Output iOS Icons.jsx | |
// 2014 Todd Linkner | |
// 2016 Larry Lai | |
// License: none (public domain) | |
// v1.3 | |
// | |
// This script is for Photoshop CC 2015. It outputs iOS icons of the following | |
// sizes from a source 1024px x 1024px PSD | |
// | |
// [name]-29.png |
// Photoshop Script to Create iPhone Icons from iTunesArtwork | |
// | |
// WARNING!!! In the rare case that there are name collisions, this script will | |
// overwrite (delete perminently) files in the same folder in which the selected | |
// iTunesArtwork file is located. Therefore, to be safe, before running the | |
// script, it's best to make sure the selected iTuensArtwork file is the only | |
// file in its containing folder. | |
// | |
// Copyright (c) 2010 Matt Di Pasquale | |
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com |
// Photoshop Script to Create iPhone Icons from iTunesArtwork | |
// | |
// WARNING!!! In the rare case that there are name collisions, this script will | |
// overwrite (delete perminently) files in the same folder in which the selected | |
// iTunesArtwork file is located. Therefore, to be safe, before running the | |
// script, it's best to make sure the selected iTuensArtwork file is the only | |
// file in its containing folder. | |
// | |
// Copyright (c) 2010 Matt Di Pasquale | |
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com |
// Output Android Icons.jsx | |
// 2012 Todd Linkner | |
// License: none (public domain) | |
// v1.0 | |
// | |
// This script is for Photoshop CS6. It outputs Android icons of the | |
// following sizes from a source PSD at least 512px x 512px | |
// | |
// store: | |
// Icon.png (512px x 512px) |
localeIdentifier | Description | |
---|---|---|
eu | Basque | |
hr_BA | Croatian (Bosnia & Herzegovina) | |
en_CM | English (Cameroon) | |
rw_RW | Kinyarwanda (Rwanda) | |
en_SZ | English (Swaziland) | |
tk_Latn | Turkmen (Latin) | |
he_IL | Hebrew (Israel) | |
ar | Arabic | |
uz_Arab | Uzbek (Arabic) |
private const int CircleSegmentCount = 64; | |
private const int CircleVertexCount = CircleSegmentCount + 2; | |
private const int CircleIndexCount = CircleSegmentCount * 3; | |
private static Mesh GenerateCircleMesh() | |
{ | |
var circle = new Mesh(); | |
var vertices = new List<Vector3>(CircleVertexCount); | |
var indices = new int[CircleIndexCount]; | |
var segmentWidth = Mathf.PI * 2f / CircleSegmentCount; |
#include <ctime> | |
#include <iostream> | |
#include <string> | |
#include <sstream> | |
//----------------------------------------------------------------------------- | |
// Notes: | |
// 1) You should make full project rebuild during customer build | |
// 2) Keep error handling simple: just print message to cout and call exit(-1) | |
// 3) You can customize the number of days in evaluation period: |