This file contains hidden or 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
| //다큐먼트 디렉토리 로그로 찍어보기 | |
| NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
| NSString *documentPath = [searchPaths objectAtIndex:0]; | |
| NSLog(@"다큐먼트 디렉토리 : %@", documentPath); |
This file contains hidden or 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
| // handy tool for troubleshooting Core Data using X-Code scheme | |
| 1. select project file in X-Code | |
| 2. choose Edit Scheme... from the menu | |
| 3. Click the “Run yourapp.app” option | |
| 4. In the Arguments Passed On Launch section, add the following : -com.apple.CoreData.SQLDebug 1 | |
| 5. Press OK and run the app | |
| // Now you see lot's of information in the Debug Area |
This file contains hidden or 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
| //파일/디렉토리 삭제 (code snippet that can use to remove any file or folder) | |
| - (void)removePhotoFile | |
| { | |
| NSString *path = [self photoPath]; | |
| NSFileManager *fileManager = [NSFileManager defaultManager]; | |
| if ([fileManager fileExistsAtPath:path]) { | |
| NSError *error; |
This file contains hidden or 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
| //NSString category : addRandomWord | |
| //for example : | |
| //NSString+RandomWord.h | |
| @interface NSString (RandomWord) | |
| - (NSString *)addRandomWord; |
This file contains hidden or 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
| //UIImage+Resize 카테고리 | |
| //UIImage+Resize.h | |
| @interface UIImage (Resize) | |
| - (UIImage *)resizedImageWithBounds:(CGSize)bounds; | |
| @end |
This file contains hidden or 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 시스템 폰트 | |
| for (NSString* s in [UIFont familyNames]) | |
| NSLog(@"%@: %@", s, [UIFont fontNamesForFamilyName:s]); | |
| 2014-01-16 20:27:47.509 StoreSearch[856:60b]() Thonburi: ( | |
| "Thonburi-Bold", |
This file contains hidden or 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 Dynamic Type font Text Styles | |
| These constants provide semantic descriptions of the intended use for a font returned by the UIFont class method preferredFontForTextStyle: or a font descriptor returned by preferredFontDescriptorWithTextStyle:. | |
| NSString *const UIFontTextStyleHeadline; | |
| NSString *const UIFontTextStyleSubheadline; | |
| NSString *const UIFontTextStyleBody; | |
| NSString *const UIFontTextStyleFootnote; | |
| NSString *const UIFontTextStyleCaption1; | |
| NSString *const UIFontTextStyleCaption2; |
This file contains hidden or 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 Dynamic Type Font Test | |
| //In this example, we have a label (self.lab) whose font uses Dynamic Type; | |
| //we set its font both when the label first appears in the interface and subsequently | |
| //whenever UIContentSizeCategoryDidChangeNotification arrives: | |
| - (void)viewDidLoad { | |
| [super viewDidLoad]; | |
| [self doDynamicType:nil]; |
This file contains hidden or 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
| //iTunes Search Terms (HTTP request) | |
| //http://itunes.apple.com/search?term=the search term | |
| http://itunes.apple.com/search?term=metallica | |
| //make the search more specific | |
| http://itunes.apple.com/search?term=metallica&entity=song | |
| //If the search term has a space in it, replace it with a + sign |
This file contains hidden or 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
| //make imbeded view (임베디드 뷰 만들기) | |
| //1. add a new file to the project. name it new file (in this case LandscapeViewController). make sub- class of UIViewController and make XIB also | |
| //2. select the nib, change its Orientation (in the Attributes Inspector), change the Background Color if you want | |
| //3. disable Auto Layout for the nib if you want | |
| //4. drag a new Label into the nib and give it some text (just for test) | |
| //in a parent view (in this case SearchViewController) |