This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//iOS 7 스토리보드 대신 xib 방식으로 개발하기 | |
//solution 1 | |
1. empty application 생성 | |
2. new class file 생성 -> name : ViewController, UIViewController sub class, with XIB check | |
3. appdelegate 헤더 파일 수정 | |
@class ViewController; | |
@property (strong, nonatomic) ViewController *viewController; | |
4. appdelegate m 파일 수정 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//two ways of making UITableView Cell | |
//ex | |
//1. much simpler | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
static NSString *CellIdentifier = @"Cell"; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
// Configure the cell... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//UITextView subclass for supporting string, regex search and highlighting | |
//Created by Ivano Bilenchi on 05/11/13 | |
//ICAppDelegate.h | |
@interface ICAppDelegate : UIResponder <UIApplicationDelegate> | |
@property (strong, nonatomic) UIWindow *window; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//delegate pattern | |
//delegate pattern is commonly used to handle the following situation | |
//ex) | |
//screen A opens screen B and at some point screen B needs to communicate back to screen A, for example when it closes. | |
//The solution is to make A a delegate of B so screen B can send its messages to A whenever it needs to. | |
//Screen A launches screen B and becomes its delegate | |
//The cool thing about the delegate pattern is that screen B doesn’t really know anything about screen A. | |
//It just knows that some object is its delegate. Other than that, screen B doesn’t care who that is. Just like UITableView doesn’t really care about your view controller, only that it delivers table view cells when the table view asks for them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//count items and update table views lable | |
//loops through the ChecklistItem objects from the items array | |
//If the item object has its checked property set to NO, increment the local variable count by 1 | |
//When looked at all the objects, return the value of this count to the caller | |
//Checklist.h | |
- (int)countUncheckedItems; | |
//Checklist.m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//dealing with UIImagePickerController and UIActionSheet | |
//ImageViewController.h | |
@interface ImageViewController : UIViewController | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//getting locaton | |
//1. MyLocations Project Settings | |
//use tab bar controller | |
//import CoreLocation.framework | |
//CurrentLocationViewController.h | |
#import <CoreLocation/CoreLocation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//dataModel using plist file and save to documents directory | |
#import "DataModel.h" | |
#import "Checklist.h" //first time runs the app then create a new Checklist object | |
@implementation DataModel | |
#define debug 1 | |
#pragma mark - 다큐먼트 디렉토리 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
assign and copy properties | |
Property with ’retain (or strong)’ attribute must be of object type | |
so, declare a property as assign if it has a primitive value | |
@property (nonatomic, assign) int someNumber; | |
You also use assign for structs, because they aren’t objects either | |
@property (nonatomic, assign) CLLocationCoordinate2D coordinate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//making basic UICollectionView | |
//UICollectionView 주요 메소드 (UITableView와 비교) | |
//UICollectionView vs UITableView | |
//Item(Cell) 갯수(필수) | |
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section | |
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | |
//Item(Cell) 꾸미기(필수) |
NewerOlder