Skip to content

Instantly share code, notes, and snippets.

@satoshin2071
satoshin2071 / gist:90abf27a1ee67e28b35d
Created August 1, 2014 07:30
[iOS]プライバシーの設定を削除する
開発を行っている時にマイクへのアクセス許可などの設定を初期化したいときがある。
アプリを削除すればいけそうな感があるが、記憶され続けるので再インストールしても前の情報が残ったまま。
設定→リセット→位置情報とプライバシーのリセット で初期化される。(※個別には削除できない)
@satoshin2071
satoshin2071 / file0.txt
Created October 7, 2014 11:50
UITextFiled(xib)でUITextBorderStyleRoundedRectのまま高さを変更する ref: http://qiita.com/satoshin2071/items/5f6177fce2e9dc64e0c6
<rect key="frame" x="10" y="20" width="300" height="30"/>
<rect key="frame" x="10" y="20" width="300" height="40"/>
@satoshin2071
satoshin2071 / NSDate+Appoint.h
Last active August 29, 2015 14:07
カテゴリ
//
// NSDate+Appoint.h
//
// Created by ssato on 2014/10/08.
// Copyright (c) 2014年 eplus. All rights reserved.
//
#import <Foundation/Foundation.h>
#pragma mark interface ----
@satoshin2071
satoshin2071 / file0.txt
Created November 6, 2014 03:48
UICollectionViewでSDWebImageを表示するときにindexPathがzombieになる ref: http://qiita.com/satoshin2071/items/274f3dd4e4b3159667b9
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
CollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:_cellIdentifier forIndexPath:indexPath];
// item取得
HogeClass item = self.items[indexPath.row];
// item.urlを使用して画像読み込み
[self.thumbnail sd_setImageWithURL:[NSURL URLWithString:item.url] placeholderImage:nil options:0 progress:nil needIndicatorColor:NO completed:nil];
@satoshin2071
satoshin2071 / gist:aefc23c2aa968cc27fe3
Last active November 13, 2018 07:41
CoreFoundation Intro

#CoreFoundation入門 イントロ

##概要

デバッグ中にCF〜とかコンソールに表示されるが、そもそもCoreFoundationとはなんぞ?というレベルなのでこの機会に調べてみたいと思った。

以下をガイドとしてCoreFoundation の世界に飛び込みたい。

永野哲久氏[Hello, Core Foundation]

@satoshin2071
satoshin2071 / gist:e8636d042e0c403ce287
Last active January 5, 2024 16:41
CoreFoundation入門 CFStringとその周辺

#CoreFoundation入門 CFStrringとその周辺

##概要

入門 イントロのHello,Worldで使用した「CFSTR("Hello, World!")」からCoreFoundationの実装を追っていく。

##CFStringの実装

まずはCFSTRのリファレンスを確認。CFStringRef型ということわかる。

@satoshin2071
satoshin2071 / gist:08daecc13c9e293e70d3
Last active February 25, 2019 13:17
CoreFoundation入門 Toll-free bridge

#CoreFoundation入門 Toll-free bridge

##概要 CoreFoundation入門 CFStringとその周辺の続き。

CoreFoundation入門 イントロで説明したFoundationとCoreFoundationの互換性を実現するToll-free bridgeの仕組みを確認していく。

##Tool-free bridgeとは

CocoaのオブジェクトをCoreFoundationから、そしてCoreFoundationのオブジェクトをCocoaから呼ぶ事ができる仕組み。

@satoshin2071
satoshin2071 / gist:c99400015b95060d4e63
Last active April 2, 2021 21:59
CoreFoundation入門 メモリ管理

#CoreFoundation入門 メモリ管理

##概要

CoreFoundationのルートクラス的存在であるCFTypeの中から一番使用するであろう、メモリ管理関連のメソッドを確認。

##リファレンスカウント方式のメモリ管理

CoreFoundationはObjective-Cと同様の生成/保持/解放のリファレンスカウント方式。生成したらオーナーシップを持ち、必要なくなったらオーナーシップを破棄するのが必須なのも一緒。

@satoshin2071
satoshin2071 / gist:b32dd8f16bece6320576
Created November 13, 2014 09:58
openFrameworks 0.8.4 iOS + Xcode6でビルド出来ないときの対処法
main.mmに以下を追加
extern "C"{
size_t fwrite$UNIX2003( const void *a, size_t b, size_t c, FILE *d )
{
return fwrite(a, b, c, d);
}
char* strerror$UNIX2003( int errnum )
{
return strerror(errnum);
@satoshin2071
satoshin2071 / gist:cc3a982b9b65dc9b8f20
Last active May 26, 2020 07:52
CoreFoundation入門 基本クラス

#CoreFoundation入門 基本クラス

##概要

Core Foundationで頻出するドキュメントにて「Derived from CFPropertyList」となっている以下の基本クラスを確認。

CFData, CFString, CFArray, CFDictionary, CFDate, CFNumber(CFBoolean)

※CFNumber、CFDate以外は上記のImutable型に対してそれぞれMutablel型が用意されている。