레시피들 냠냠

방커뮤니티 요리방 

더블피의 뚝딱쿠킹 추천해드려요. 옛날것부터 정주행 하시고 재밌어 보이는 거 따라해보세요.

나물이네 -> 레시피가 많고, 단순화되어 있어서 따라하기 편해요

뻔와이프 -> 일반적인 한국 가정식 레시피가 잘 나와 있어요. 

82cook -> 재료 구입이나, 보관 등 살림 전반에 대해 잘 알 수 있어요



재밌는 생활의 달인 놀이


Home button & Background Object C

application.applicationState로 홈버튼 VS 대기시간 확인.


[[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:...]

로 최대 10분간 background에서 작업 가능




뷰 컨트롤러간 값 전달 - 델리게이트 Object C

펌 : http://cafe.naver.com/mcbugi/21370

노티피케이션이나 델리게이트로 뷰 컨트롤러 사이에 값을 전달할 수 있다.



SecondViewController.h

#import <UIKit/UIKit.h>


@protocol SecondViewControllerDelegate;


@interface SecondViewController : UIViewController {

UITextField *textField;

id<SecondViewControllerDelegatedelegate;

}

@property (nonatomic,assignid<SecondViewControllerDelegate> delegate;


@end


@protocol SecondViewControllerDelegate<NSObject>;


@required


-(void) secondViewControllerInputDidEnd:(NSString *)text;


@end


그 다음에 SecondViewController.m파일을 봅시다


//property 지정한 delegate 다른 오브젝트에서 써줘야 하니 @synthesize 접근가능하게 하는걸 잊지 맙시다.

@synthesize delegate; 


- (void)viewDidLoad {

    [super viewDidLoad];

self.title = @"Second ViewController";

UIBarButtonItem *doneButton = [[UIBarButtonItem allocinitWithTitle:@"Done"style:UIBarButtonSystemItemSave target:self action:@selector(done)];

self.navigationItem.rightBarButtonItem = doneButton;

[doneButton release];

textField = [[UITextField allocinitWithFrame:CGRectMake(101030025)];

textField.borderStyle = UITextBorderStyleRoundedRect;

[self.view addSubview:textField];

}


-(void) done{

[self.delegate secondViewControllerInputDidEnd:textField.text];

[self.navigationController popViewControllerAnimated:YES];

}



원글

카테고리와 프로토콜 Object C

카테고리

기존 class에 메서드만 추가하는 것.

기존 class instance변수에 접근할 수 있지만, 새 instance 변수 추가는 안됨.


)

@interface ClassName (CategoryName)

- Method

- Method

@end


@implementation ClassName (CategoryName)





프로토콜

클래스 사이에 공유되는 메서드 목록.

프로토콜을 따른다면, 프로토콜에 들어있는 메서드를 모두 구현해 주어야함.


objbect가 프로토콜을 따른다고 다음처럼 선언할 수 있음.

id <ProtocolName> objectName


예 )

@protocol ProtocolName

- Method

- Mehtod

@optional

- Mehtod

@required

- Method

@end


@interface ClassName: ParentClassName <ProtocolName1, ProtocolName2>

@end


1 2 3 4 5 6 7 8 9 10 다음