Created
April 24, 2014 07:32
-
-
Save tanb/11245010 to your computer and use it in GitHub Desktop.
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
// MyViews.xib に複数のViewをいれました | |
NSArray *nibContents = [[NSBundle mainBundle] loadNibNamed:@"MyViews" owner:nil options:nil]; | |
// RestorationIDに適当な名前をつけておいて取り出しました | |
__block UIView *targetView = nil; | |
[nibContents enumerateObjectsUsingBlock:^(UIView *view, NSUInteger idx, BOOL *stop) { | |
if ([view.restorationIdentifier isEqualToString:@"MyView"]) { | |
*stop = YES; | |
targetView = (UIView *)view; | |
} | |
}]; // targetViewは"MyView"というRestorationIDをつけたview |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment