2015년 3월 18일 수요일

열두번째 날: MySQL을 NoSQL로 사용하기

http://advent.perl.kr/2012/2012-12-12.html

2015년 3월 16일 월요일

Node.js로 푸시서비스 구현하기 1. 아이폰(iOS) 푸시서버 구현하기

http://blog.saltfactory.net/215

get-todays-photo-from-album-in-ios

http://stackoverflow.com/questions/26320876/get-todays-photo-from-album-in-ios

2015년 3월 12일 목요일

일본인이 정리한 ios 기능 설명서

http://iphone-tora.sakura.ne.jp/index.html

cocos 강좌가 많이 있는 중국 사이트

http://cn.cocos2d-x.org/tutorial/lists?id=49&per_page=27

2015년 3월 11일 수요일

망할놈의 autolayout

http://minsone.github.io/mac/ios/nslayoutconstraint/

2015년 3월 10일 화요일

Listview에 헤더 구현

http://warmz.tistory.com/673

ImageView 라운드(둥근 테두리) 처리

http://warmz.tistory.com/740

UIActivityViewController를 이용하여 다른 앱과 컨텐츠 공유하기

http://warmz.tistory.com/825

[View Animation] Flip Left/Right, Curl Up/Down

http://warmz.tistory.com/827

[Tip] Universal App 개발시 현재 단말기가 아이폰인지 아이패드인지 구별하 는 방법

http://warmz.tistory.com/830

IOS GDC , BLOCK-Coding 아주 좋은글.

http://warmz.tistory.com/831

영상처리-수학-기본

http://moguwai.tistory.com/entry/%EC%98%81%EC%83%81%EC%B2%98%EB%A6%AC-%EC%88%98%ED%95%99-%EA%B8%B0%EB%B3%B8

[IOS] UUID 생성 및 키체인 저장

http://reysion.tistory.com/55

고급 오토레이아웃(auto layout) -AutoLayout Programmatically 사용하기

http://www.letmecompile.com/advanced-auto-layout/

animating-an-uiimageview-view-from-point-a-to-point-b-with-constraints-program

http://stackoverflow.com/questions/14913949/animating-an-uiimageview-view-from-point-a-to-point-b-with-constraints-program

2015년 3월 9일 월요일

xcode 에서 에러의 위치를 보여주지 않을때

http://leo81.tistory.com/5

xcode 에서 svn 연동하기

http://leo81.tistory.com/41

위처럼 한다음

checkout 에서  임포트했던 프로젝트를 선택한다음 , 다시 맥에서 새로운 폴더에 받으면

자동으로 xcode 가 열리면서 보임.

이제 작업하고 commit 하면 됨.

아이폰에서 화면터치 무시하기

http://dongss.tistory.com/entry/iOS-%EC%95%84%EC%9D%B4%ED%8F%B0-%EA%B0%9C%EB%B0%9C-%ED%99%94%EB%A9%B4%EC%83%81%EC%97%90%EC%84%9C-%ED%84%B0%EC%B9%98-%EC%9D%B4%EB%B2%A4%ED%8A%B8-%EB%B0%9C%EC%83%9D%EC%8B%9C-View%EC%97%90%EC%84%9C-%EB%AC%B4%EC%8B%9C%ED%95%98%EA%B8%B0-%EB%B0%A9%EB%B2%95

cocos2dx 모노폴리 예제 > _ < -중국어

http://blog.csdn.net/lideguo1979/article/month/2015/03

NSURLRequest-서버에-POST-요청-쿠키정보까지 가능

http://xcode5.tistory.com/entry/NSURLRequest-%EC%84%9C%EB%B2%84%EC%97%90-POST-%EC%9A%94%EC%B2%AD

connecting-to-php-service-from-ios.html

http://divcode.blogspot.kr/2012/08/connecting-to-php-service-from-ios.html

NSThread 를 통한 데이터 병렬처리

http://yoogomja.tistory.com/entry/NSThread%EB%A5%BC-%ED%86%B5%ED%95%9C-%EB%8D%B0%EC%9D%B4%ED%84%B0-%EC%B2%98%EB%A6%AC%EC%99%80-%ED%99%94%EB%A9%B4-%EC%A0%9C%EC%96%B4-%ED%8C%81

2015년 3월 4일 수요일

cocos2dx 동영상강좌 무료인곳

http://www.sonarlearning.co.uk/coursepage.php?topic=game&course=cocos2d-x-v3

iOS - Uploading image by HTTP POST

http://stackoverflow.com/questions/24182573/ios-uploading-image-by-http-post

http://parangma.tistory.com/109 -한글

screen 캡춰

http://redhan.tistory.com/37

ios webview 쿠키

http://www.picomax.net/xe/study/22881

ios multipart http post

http://stackoverflow.com/questions/8564833/ios-upload-image-and-text-using-http-post

http://stackoverflow.com/questions/24250475/post-multipart-form-data-with-objective-c

http://vulpecula.tistory.com/40 한글

2015년 3월 3일 화요일

collection view 에서 멀티셀렉트

http://www.appcoda.com/ios-collection-view-tutorial/

2015년 3월 2일 월요일

컬렉션 뷰(UICollectionView) #5. Layout, 그리고 Flow Layout-설명이잘되어 있는...

http://covelist.tistory.com/9

아이폰용 오픈소스 링크들

http://blueamor.tistory.com/818

아이폰 자잘한팁들

http://inhoda.blogspot.kr/2012/02/blog-post.html

2015년 3월 1일 일요일

[objc] 앨범에서 마지막으로 찍은 사진 가져오기

    ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];



    // Enumerate just the photos and videos group by using ALAssetsGroupSavedPhotos.


    [library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group,BOOL *stop) {



        // Within the group enumeration block, filter to enumerate just photos.


        [group setAssetsFilter:[ALAssetsFilter allPhotos]];



        // Chooses the photo at the last index


        [group enumerateAssetsAtIndexes:[NSIndexSet indexSetWithIndex:([group numberOfAssets] - 1)]options:0 usingBlock:^(ALAsset *alAsset, NSUInteger index, BOOL *innerStop) {



            // The end of the enumeration is signaled by asset == nil.


            if (alAsset) {


                ALAssetRepresentation *representation = [alAsset defaultRepresentation];


                UIImage *latestPhoto = [UIImage imageWithCGImage:[representation fullScreenImage]];


                [latestPhoto resizeImageToWidth:50];



                if (latestPhoto){


                    [self.imgBtn setBackgroundImage:latestPhoto forState:UIControlStateNormal];


                    [self.imgBtn setBackgroundImage:latestPhoto forState:UIControlStateHighlighted];


                }


            }


        }];


    } failureBlock: ^(NSError *error) {


    }];

tableview 에 앨범 제목표시

http://www.appcoda.com/uitableview-tutorial-storyboard-xcode5/

http://www.mindfiresolutions.com/Using-Groups-How-to-retrieve-data-from-Photos-Application-in-iOS-device-1720.php

앨범에서 마지막 찍은 사진 가져오기

    ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];



    // Enumerate just the photos and videos group by using ALAssetsGroupSavedPhotos.


    [library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group,BOOL *stop) {



        // Within the group enumeration block, filter to enumerate just photos.


        [group setAssetsFilter:[ALAssetsFilter allPhotos]];



        // Chooses the photo at the last index


        [group enumerateAssetsAtIndexes:[NSIndexSet indexSetWithIndex:([group numberOfAssets] - 1)]options:0 usingBlock:^(ALAsset *alAsset, NSUInteger index, BOOL *innerStop) {



            // The end of the enumeration is signaled by asset == nil.


            if (alAsset) {


                ALAssetRepresentation *representation = [alAsset defaultRepresentation];


                UIImage *latestPhoto = [UIImage imageWithCGImage:[representation fullScreenImage]];


                [latestPhoto resizeImageToWidth:50];



                if (latestPhoto){


                    [self.imgBtn setBackgroundImage:latestPhoto forState:UIControlStateNormal];


                    [self.imgBtn setBackgroundImage:latestPhoto forState:UIControlStateHighlighted];


                }


            }


        }];


    } failureBlock: ^(NSError *error) {


    }];

인스턴스 마다 의 공유 값들은 프로토타입에 저장

인스턴스 마다 의 공유 값들은 프로토타입에 저장

커링 함수에 bind 사용하기

bind 는 기존의 함수나  메소드 에 영향을 주지않고 임시로 추가적인 함수를 만들어서 기존의 함수에 적용 을 시킨다.

function SimpleURL(protocol, domain, path){
return protocol + "://"+domain+"/"+path;
}

1.ㅂㅏ인드를 ㅅㅏ용하지  않는 일반적인 방법

var urls=paths.map(function(path){
return SimpleURL("http",sitedomain,path);
});

2.바인드를 사용 하여 심플 하게 변경

기 존의 함수에 bind(this, arg,arg) 식으로 선언하면,  arg 개수 를 가진 무명의 함수를 생성하여 이를 리 턴하고 다시 원래의 함수 를 호출(위임)하여   준다.

아래 예제에서는 simpleURL 에서는 this 등이 사용되지  않기 때문에 null  을 첫번째 인자로,

protocol과 domain 을 두번쨰 인자로 취하여 bind 가 새로운 함수를  생성한다음 함수리턴을 하고,

리턴된  함수 의 마지막에 path(map 에 의해 추출된 변수..여기서는  무명변수) 를  인자로 붙여 simpleurl 을 실행한다.

var urls=paths.map(SimpleURL.bind(null,"http",sitedomain));

고차함수

익명함수를  이용한  고차함수

------------

var a=[3,1,4,5,6].sort(function(x,y){
if(x<y) {return -1;}
if(x>y) {return 1;}
return 0;
});
console.log(a);

----------------------

맵을 이용한 고차함수

var a=["Fred","Willar","Peblle"].map(function(name){

return name.toUpperCase();
});
console.log(a);

----------------------

callback 이용한 고차함수

var aIndex="a".charCodeAt(0);
function buildString(n,callback){
var result="";
for(var i=0;i<n;i++){
result +=callback(i);
}
return result;
}

var alphabet=buildString(26,function(i){
return String.fromCharCode(aIndex+i);
});
var digit=buildString(10,function(i){
return i;
});
console.log(alphabet);
console.log(digit);

this 에 대한 심플예제1

-  this  의 범위를 이용하여 공유변수등을 만들때

obj 의 this 는 obj2,obj3 에서 사용될 때  호이스트 규칙에 의해 자신 을 포함하는 객체가 된다.

var obj={
hello:function(){
return "hi,"+this.username;
},
username:"hehe"
};
var obj2={
hello:obj.hello,
username:"taeho"
};
var obj3={
hello:obj.hello,
username:"yejin"
};
console.log(obj2.hello());
console.log(obj3.hello());

지연변수 스코프를 만들기위해 즉시 실행함수 표현식 사용법

반복문등에서 클로져를  이용하 여 지역변수를 참조하려할때, 클로저에서 변수값을 복사가 아닌 참조를 ㅎㅏ는 특성때 문에 반복 문의 마지막 변수만 참조하는 문제점이 있다.

--------------

function wrapElements(a){
var result=[];
for(var i=0,n=a.length;i<n;i++){
result[i]=function(){return a[i];};
}

}
var wrapped=wrapElements([10,20,30]);
var f=wrapped[0];
f();

이때,클로 져를  즉시실행함수로 감싸서  즉 시 실행함수에서  별도의 변 수 에 반복문의 반복 변수등을 복사저장한다음 클로져를 사용하면 된다.

function wrapElements(a){
var result=[];
for(var i=0,n=a.length;i<n;i++){
//즉시실행함수에서 i 값을 j 로 복제한다.
(function(j){
//result[i] 값이 객체로 온다는 것 주의
result[i]=function(){return a[j];};
})(i);

}
return result;

}
var wrapped=wrapElements([10,20,30]);
//리턴
var f=wrapped[1];
console.log(f());

클로저 심플예제

클로저는 외부 변수의 값을 복사하지 않고 참조한다.


1.자바스크립트는 현재함수의 외부에 있는 변수를 가져와서 사용할수도 있다.


----------------------------------------


function makeSandwich(){
var magicIngredient="peanut butter";
function make(filling){
return magicIngredient + "and "+ filling;
}
return make;
}
var f=makeSandwich();


console.log(f("hehe"));
console.log(f("jelly"));
console.log(f("bananas"));


--------------------------------------


2.함수는 외부함수가 무언가ㄴ를 리턴한 이후에도 외부함수에 선언도니 변수를 참조할수 있다. 즉 함수내의 변수를 지속적으로 고정,공유할수 있다.


function makeSandwich(magicIngredient){
return function (filling){
return magicIngredient + " and "+ filling;
}
return make;
}
var f=makeSandwich("ham");


console.log(f("hehe"));
console.log(f("jelly"));


-----------------------------------


3.클로져는 외부 변수의 값을 변경할수 있다.


function box(){
var val=undefined;
return {
set:function(newVal){ val=newVal;},
get:function(){return val;},
type:function(){return typeof val;}
}

}
var b=box();
b.type();
b.set("76.1");
console.log(b.get());
console.log(b.type());