Created
April 22, 2012 09:17
-
-
Save onevcat/2462909 to your computer and use it in GitHub Desktop.
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
-(NSArray *)loadPadNibNamed:(NSString *)name owner:(id)owner options:(NSDictionary *)options { | |
NSString *newName = [name stringByReplacingOccurrencesOfString:@"@pad" withString:@""]; | |
newName = [newName stringByAppendingFormat:@"@pad"]; | |
//判断是否存在 | |
NSFileManager *fm = [NSFileManager defaultManager]; | |
NSString* filepath = [[NSBundle mainBundle] pathForResource:newName ofType:@"nib"]; | |
//这里调用的loadPadNibNamed:owner:options:实际为为交换后的方法,即loadNibNamed:owner:options: | |
if ([fm fileExistsAtPath:filepath]) { | |
return [self loadPadNibNamed:newName owner:owner options:options]; | |
} else { | |
return [self loadPadNibNamed:name owner:owner options:options]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment