iOS6에서 UITableViewCell 위에 올라간 UILabel, UIButton 등의 객체를 참조할 때의 코드가 iOS7에서 조금 변경되었다.

- iOS6

    UITableViewCell

      ↳  UITableViewCellContentView

           ↳ UILabel ...


- iOS7

    UITableViewCell

      ↳ UITableViewCellScrollView  <- 추가됨.

           ↳ UILabel...

           ↳ UITableViewCellContentView

                ↳ UILabel ...


그래서 iOS6에서 Cell 아래에 있는 Label등에 접근할 때, 또는 Cell 위에 아래와 같이 버튼을 올렸을 경우

  UIButton *button3 = [UIButton buttonWithType:UIButtonTypeCustom];      

  [button3 setFrame:CGRectMake(145100113)];         

  [button3 addTarget:self action:@selector(cellButtonAction:) 

     forControlEvents:UIControlEventTouchUpInside];

  [cell.contentView addSubview:button3];


- iOS6까지는 아래와 같이 접근이 가능했음.

        UITableViewCell *cell = (UITableViewCell *)[[(UIView *) sender superviewsuperview];

    UITableView *tableView = (UITableView *)[cell superview];

    NSIndexPath *cellIndexPath = [tableView indexPathForCell:cell];

    NSUInteger row = [cellIndexPath row];


- iOS7 에서는 Cell과 ContentView 사이에 UITableViewCellScrollView 가 추가되고, 

UITableView와 Cell 사이에 UITableViewWrapperView가 추가되었다. 그래서 접근하기 위해서는 superview가 더 필요하다.

    UITableViewCell *cell = (UITableViewCell *)[[[(UIView *) sender superviewsuperviewsuperview];

    UITableView *tableView = (UITableView *)[[cell superviewsuperview];

    NSIndexPath *cellIndexPath = [tableView indexPathForCell:cell];

    NSUInteger row = [cellIndexPath row];


UITableViewCellScrollView?

  - UITableViewCell에 추가된 Private Class.

  - iOS7에서 Cell을 삭제할 때 왼쪽으로 스크롤해야하는데, 이 때 사용되는 것으로 보임.


UITableViewWrapperView? 

  - Private Class 같은데, 용도를 아직 모르겠음. 

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

추가사항. 

위에서 예로 든 경우 superview를 이용해서 접근하고 있는데, 아래와 같은 방법으로 이용하는게 좀 더 안전한 방법임을 다른 분이 알려줌.


- (void)btnPressed:(id)sender

{

   CGPoint btnPos = [sender convertPoint:CGPointZero toView:tableView];

   NSIndexPath *ip = [tableView indexPathForRowAtPoint:btnPos];

   if (ip != nil) {

      ...

   }

}


Posted by 프리지크
:

XCode 단축키.

2013. 9. 26. 09:52

(* 참고 : 아이폰과 맥 OSX 개발을 위한 Objective-C 2.0, Apress)


Command + [

코드 블록을 왼쪽으로 쉬프트.

Command + ]

코드 블록을 오른쪽으로 쉬프트.

Tab

코드를 완성한다.

Esc

코드 완성 메뉴를 보여준다.

Control + . (마침표키)

코드 완성에서 알맞은 다음 코드를 보여준다.

Shift + Control + . (마침표키)

코드 완성에서 알맞은 이전 코드를 보여준다.

Control + /

코드 완성에서 다음 입력 영역으로 이동한다.

Command + Control + S

스냅 샷을 만든다.

Control + F

커서를 앞으로 이동한다.

Control + B

커서를 뒤로 이동한다.

Control + P

커서를 이전 라인으로 이동한다.

Control + N

커서를 다음 라인으로 이동한다.

Control + A

커서를 라인의 시작으로 이동한다.

Control + E

커서를 라인의 끝으로 이동한다.

Control + T

커서에 인접한 문자를 바꾼다.

Control + D

커서에 인접한 문자를 지운다.

Control + K

라인을 지운다.

Control + L

커서를 텍스트 에디터의 가운데로 보낸다.

Option + 더블클릭

문서를 찾는다.


Posted by 프리지크
:

XCode에서 가끔씩 업그래이드 후에 프로젝트를 열 경우 Syntax Color가 풀려있는 경우가 있음.


1. Menu Window > Organizer > Projects 에서 해당 프로젝트 선택 > Derived Data를 Delete 시켜주기 > XCode restart.


그래도 안되면,

2. Product > Clean > Build 시켜주기.


Posted by 프리지크
:

iPhone URL Schemes

2013. 4. 29. 10:25

iPhone에서 사용되는 URL Schemes가 정리 된 곳.

IPhone URL Schemes

This page centralizes code samples for URL schemes available in many iPhone applications, not only in Apple's but in many others. It also includes programming tips and references about implementing apps registering or consuming URL schemes.

http://wiki.akosma.com/IPhone_URL_Schemes

Posted by 프리지크
:

 XCode로 디버깅 할 때 쓰는 Instrument에서 컬럼에 대한 간략하게 정리해본다.


- Live Bytes

    : 해당 Category의 객체에 현재 할당(allocated)된 메모리의 사용량을 보여준다.

- # Living

    : 메모리에 남아 있는 해당 Category의 객체의 수를 보여준다.

- Overall Bytes

    : 해당 Category의 객체가 현재까지 사용한 메모리의 총량을 보여준다. 총량은 메모리에 남아 있지 않은 것도 포함한다.  

 - #Overall

    : 현재까지 사용한 객체의 총 수를 보여준다.

 - #Transitory

    : #Living 과 #Overall의 차이.



참고 : 

http://d.hatena.ne.jp/shu223/20110502/1304333582

https://developer.apple.com/library/mac/#documentation/developertools/conceptual/InstrumentsUserGuide/Introduction/Introduction.html

Posted by 프리지크
:

아이폰에서 두개의 앱간에 데이터를 공유하기 위한 방안이 필요하여 한번 알아보았다.

역시나 방법은 별로 없다. ;;;

우선 기본적으로 아이폰은 샌드박스형으로 타 앱과 공유를 할 수 없다.

다만, 일부 지원과 편법을 이용할 수는 있다.


1. 정식(?)

   1) URL Scheme 이용.

      ; 해당 앱을 알고 있는 경우에나 가능할 듯.

      예제) 발송측 : [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"theOtherApp://dataToShare"]];

            수신측 : -application:handleOpenURL: 


  2) UIPasteboard 을 이용.

      ; Copy&Paste 를 이용하는 것인데, 다른 것이 복사가 되면 이전 데이터는 안녕~

      예제) UIPasteboard* board = [UIPasteboard generalPasteboard];

               board.string = @"Some string to share";


      ; 위의 메소드를 이용할 경우에는 덮어쓰기로 인해 데이터가 저장이 안되지만, 각 paste 별로 네임을 줄 경우 유지가 됨. 중간에 @"Copy1"이라는 이름으로 다른 앱에서 덮어쓰기를 할 수도 있지만, 쉽게 공유되지 않는 명칭을 준다면 앱간 데이트를 잠시 동안은 공유가 될 것 같음. 데이터 유지 조건은 가이드 확인 필요. (2013.04.24) (https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIPasteboard_Class/Reference.html)

      예제)

    - Copy

     UIPasteboard *paste = [UIPasteboard pasteboardWithName:@"Copy1" create:YES];

     paste.persistent = YES;

     [paste setString:@"Copy1 String"];

    - Paste

      UIPasteboard *paste = [UIPasteboard pasteboardWithName:@"Copy1" create:YES];

      NSLog(@"paste : %@", [paste string]);



2. 꼼수

  1) Address Book 이용

     : 주소록에 더미데이터를 추가해서 이용. 사용자에게 안 좋아보임.

  2) KeyChain 

     : 작은 데이터라면 이용해볼만할 듯. NSDictionay로 객체를 넣어서 사용한다고도 함.

    -> Bundle Seed Id를 이용하여 공유가 가능.

        참고 URL : http://shaune.com.au/ios-keychain-sharing-data-between-apps/

 3) 공유된 폴더로 Read/Write

     :  /var/mobile/Library/AddressBook, Keyboard, Preferences 에 접근해서 사용.

       SDK 사용 룰에 위배되어서 리젝의 가능성 있음.



참고 URL

  - http://stackoverflow.com/questions/2091912/data-share-between-two-iphone-apps

  - http://stackoverflow.com/questions/8228725/is-there-a-shared-pool-of-memory-for-files-in-ios

  - https://developer.apple.com/library/ios/#documentation/FileManagement/Conceptual/FileSystemProgrammingGUide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW2


Posted by 프리지크
:

URL Connection 중에 발생하는 오류들.

URL Loading System Error Codes

These values are returned as the error code property of an NSError object with the domain “NSURLErrorDomain”.

enum
{
   NSURLErrorUnknown = -1,
   NSURLErrorCancelled = -999,
   NSURLErrorBadURL = -1000,
   NSURLErrorTimedOut = -1001,
   NSURLErrorUnsupportedURL = -1002,
   NSURLErrorCannotFindHost = -1003,
   NSURLErrorCannotConnectToHost = -1004,
   NSURLErrorDataLengthExceedsMaximum = -1103,
   NSURLErrorNetworkConnectionLost = -1005,
   NSURLErrorDNSLookupFailed = -1006,
   NSURLErrorHTTPTooManyRedirects = -1007,
   NSURLErrorResourceUnavailable = -1008,
   NSURLErrorNotConnectedToInternet = -1009,
   NSURLErrorRedirectToNonExistentLocation = -1010,
   NSURLErrorBadServerResponse = -1011,
   NSURLErrorUserCancelledAuthentication = -1012,
   NSURLErrorUserAuthenticationRequired = -1013,
   NSURLErrorZeroByteResource = -1014,
   NSURLErrorCannotDecodeRawData = -1015,
   NSURLErrorCannotDecodeContentData = -1016,
   NSURLErrorCannotParseResponse = -1017,
   NSURLErrorInternationalRoamingOff = -1018,
   NSURLErrorCallIsActive = -1019,
   NSURLErrorDataNotAllowed = -1020,
   NSURLErrorRequestBodyStreamExhausted = -1021,
   NSURLErrorFileDoesNotExist = -1100,
   NSURLErrorFileIsDirectory = -1101,
   NSURLErrorNoPermissionsToReadFile = -1102,
   NSURLErrorSecureConnectionFailed = -1200,
   NSURLErrorServerCertificateHasBadDate = -1201,
   NSURLErrorServerCertificateUntrusted = -1202,
   NSURLErrorServerCertificateHasUnknownRoot = -1203,
   NSURLErrorServerCertificateNotYetValid = -1204,
   NSURLErrorClientCertificateRejected = -1205,
   NSURLErrorClientCertificateRequired = -1206,
   NSURLErrorCannotLoadFromNetwork = -2000,
   NSURLErrorCannotCreateFile = -3000,
   NSURLErrorCannotOpenFile = -3001,
   NSURLErrorCannotCloseFile = -3002,
   NSURLErrorCannotWriteToFile = -3003,
   NSURLErrorCannotRemoveFile = -3004,
   NSURLErrorCannotMoveFile = -3005,
   NSURLErrorDownloadDecodingFailedMidStream = -3006,
   NSURLErrorDownloadDecodingFailedToComplete = -3007
}

Posted by 프리지크
:

'기술 > iOS' 카테고리의 다른 글

iPhone에서 두 개의 앱이 데이터 공유하는 방법.  (2) 2013.03.05
URL Loading System Error Codes  (0) 2013.01.09
NSString -> NSDate 변환  (0) 2012.12.07
Image Filter 관련 사이트들.  (1) 2012.10.19
APNS 참고 사이트.  (0) 2012.07.03
Posted by 프리지크
:

 NSDateFormatter *dateformat = [[NSDateFormatter alloc] init];

// AM,PM으로 할 경우 hh

// 24시간으로 할 경우 HH

[dateformat setDateFormat:@"yyyyMMddhhmmss"];
           
NSDate *beginTime = [dateformat dateFromString:@"20120101000000"];
NSDate *endTime = [dateformat dateFromString:@"20121231235959"];
NSDate *currentTime = [NSDate date];


Posted by 프리지크
:

1. LINUX, WINDOWS, MAC OS X, iOS

   - http://www.imagemagick.org/script/index.php
      . 컨버터 유틸리티로 다양한 포맷의 이미지를 변환, 리사이즈, 합성, 생성 할 수 있음.
        (포맷변경, 확대, 축소, 리사이즈, 회전, 좌우상하반전, 흑백, 갈색효과, 밝게 어둡게, 자르기, 캔버스, 글자이미지 생성, 이미지 합성 등)
      . LINUX, UNIX, Windows, MaxOSX, iOS 등에서 사용가능한 Free Software.
      . Command-line의 이미지 에디팅 툴.
      . Source code 제공.

2. iOS

  1) Open Source
    - https://github.com/OmidH/Filtrr
      . An iOS Image filter library.(blur, sharpen, sepia 등등의 효과.)
      . 조건부 Copyright. (제작자 표시등의 조건으로 사용 가능.)
      . Source code 제공.

    - http://computer-vision-talks.com/2011/01/using-opencv-in-objective-c-code/
      . iOS의 GLImageProcessing Sample과 OpenCV을 이용한 예제.
      . 많은 예제를 지원해주는 것 같은데, 시뮬레이터상에서는 한가지만 보여짐.
        (버전 차이로 인해 다른 기능들이 안보여지는 것인지 좀 더 확인 필요.)

    - https://github.com/Nyx0uf/NYXImagesKit
      . iOS 용. (Least iOS5.1)
      . Filtering, Blurring, Enhancing, Masking, Reflecting,  Resizing, Rotating, Saving 등의 기능 제공.
      . 카테고리 형식으로 제공.
      . main.m, AppDelegate.m이 없어서 실행은 못 시켜봄. Framework에 추가해서 테스트 필요.
     
    - https://github.com/esilverberg/ios-image-filters
      . iOS용 Library, Source, MIT License.
      . Brightness, Contrast, Gamma, Noise, Posterize, Saturate, Sharpen, Sepia, Lomo, Vignette, Polaroidish, Invert 등 제공.

    - https://github.com/BradLarson/GPUImage
      . iOS. OpenGL을 이용한 (정말)다양한 필터를 제공.
      . 사진, 카메라 영상 등에도 적용 가능.
      . 커스텀 필터 제작을 위한 구조로 정리.
      . Sunset Lakers의 CTO가 여가시간을 이용해서 만들었다는 얘기가 있음. ;;;;

    - https://github.com/gobackspaces/DLCImagePickerController
      . GPUImage를 이용한 예제 프로젝트.

    - http://code.google.com/p/simple-iphone-image-processing/
      . 여러 효과들을 제공해주는 것 같은데, 활용법을 잘 모르겠음. ;;

  2) License

    - https://marketplace.appcelerator.com/apps/1192?866436543#overview
      ; iOS용 유료. $119.99/seat, 19 Basic filters, Tilt-shift effect, Flash controllable, video recording, Original filter, Realtime effete, Camera controllable.

    - http://webscripts.softpedia.com/script/Development-Scripts-js/Mobile-Development-Tools/Photo-Effects-SDK-for-iOS-73496.html
      . 여러 색감의 효과를 줄 수 있는 라이브러리. 유료.
      . 구입은? 글쎄. ;;

3. Android
    - http://xjaphx.wordpress.com/learning/tutorials/
      . 안드로이드 기본 튜토리얼을 제공.(중간에 Image Processing에 대한 내용이 있음)

    - https://github.com/AviaryInc/Mobile-Feather-SDK-for-Android
    - http://www.aviary.com/android
      . 여러 필터 효과 제공.
      . 라이브러리 형태로 제공.
      . 사진편집도구 앱이 있음.(https://play.google.com/store/apps/details?id=com.aviary.android.feather&hl=ko)

    - http://code.google.com/p/android-image-filtering/
      . Dithering, Gray Scale, Outline, Invert, Television, Neon Outline Pixelate 등 효과 제공.
      . GNU GPL v3 License

    - http://code.google.com/p/jjil/
      . Open Library.
      . 영상 처리 작업과 60가지 이미지 처리 기능 제공.
      . GNU Lesser GPL License.

4. 기타
    - http://opencv.willowgarage.com/wiki/
      ; OpenCV

    - https://github.com/pocketpixels/photoapplink
      . photoapplink, open source.
      . 다른 포토앱과 연결시켜주는 기능이 있는 것 같음. 어떻게 공유가 되는지 모르겠음.




Posted by 프리지크
:

BLOG main image
인생에서는 찾고, 노력하고, 희생할 각오가 되어 있는 것만 얻을 수 있다. (조시 매슈 애덤스) by 프리지크

공지사항

카테고리

분류 전체보기 (121)
끄적끄적 (16)
좋은 글 (9)
자료 (19)
런닝&피트니스 (18)
기술 (43)
iOS (29)
Android (1)
기타 (7)
기사 스크랩 (1)
내가 본 공연 후기 (1)
내가 가 본 맛집 (5)
괜찮아 보이는 펜션들 (4)
(4)
한장한장 (0)
비공개 스크랩 (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

Total :
Today : Yesterday :