Created
April 11, 2013 17:20
-
-
Save rbsgn/5365322 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
| + (instancetype)viewFromXIB | |
| { | |
| UINib *nib = [UINib nibWithNibName:NSStringFromClass([self class]) bundle:[NSBundle bundleForClass:[self class]]]; | |
| NSArray *objects = [nib instantiateWithOwner:nil options:nil]; | |
| for (id obj in objects) { | |
| if ([obj isKindOfClass:[self class]]) { | |
| return obj; | |
| } | |
| } | |
| NSAssert(NO, @"Can't load view from XIB"); | |
| return nil; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
А как это позволит избавиться от 2х классов с одинаковым именем?