例えば、buttonの左辺をcontainer viewから20ポイント離す場合
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
public String getImagePath(Context context, Uri uri){ | |
if ("content".equalsIgnoreCase(uri.getScheme())) { | |
if (isGoogleOldPhotosUri(uri)) { | |
// return http path, then download file. | |
return uri.getLastPathSegment(); | |
} else if (isGoogleNewPhotosUri(uri)) { | |
// copy from uri. context.getContentResolver().openInputStream(uri); | |
return copyFile(context, uri); | |
} else if (isPicasaPhotoUri(uri)) { |
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
// | |
// override a setter | |
// | |
// NSStringはcopyするという記事もあるが、copyもretainも同じ。 | |
// you do not need to make a copy when Foo is a NSString. | |
// "copy" and "retain" for NSString are internally the same action. | |
- (void)setFoo:(Foo *)aFoo { | |
if (aFoo != foo) { | |
[foo release]; | |
foo = [aFoo retain]; |
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
#import <Foundation/Foundation.h> | |
@interface NSDictionary (QueryStringBuilder) | |
- (NSString *)queryString; | |
@end |